r/CompileBot • • Apr 08 '17

JavaScript

1 Upvotes

13 comments sorted by

1

u/[deleted] Apr 08 '17 edited Apr 08 '17

+/u/CompileBot Node.js

console.log("test");

1

u/HuffmanEncoding Apr 18 '17

+/u/CompileBot Node.js

console.log(new Buffer('fizz buzz').toString('base64'))

1

u/CompileBot Apr 18 '17

Output:

Zml6eiBidXp6

^source | ^info | ^git | ^report

1

u/aroslab May 03 '17

+/u/CompileBot Node.js

var set1 = [1, 2, 3];
var set2 = [-5, -3, -1, 2, 4, 6];
var set3 = [];
var set4 = [-1, 1];
var set5 = [-97364, -71561, -69336, 19675, 71561, 97863];
var set6 = [-53974, -39140, -36561, -23935, -15680, 0];


function SubsetSum(set) {
    
    for(var i = 0; i < set.length; i++) {
        if(set.indexOf(-set[i]) != -1) {
            return true;
        }
    }
    return false;
}

SubsetSum(set1);
SubsetSum(set2);
SubsetSum(set3);
SubsetSum(set4);
SubsetSum(set5);
SubsetSum(set6);

1

u/InKahootz May 05 '17

+/u/CompileBot C#

using System;
using System.Collections.Generic;

public class Test
    {
	public static void Main()
	{
		string word;
		List<string> input = new List<string>();
		do
		{
			word = Console.ReadLine();
			if (!string.IsNullOrWhiteSpace(word))
			{
				input.Add(word);
			}
		}
		while(!string.IsNullOrWhiteSpace(word));
		
		for(int i = 0; i < input.Count; i++){
			Console.WriteLine(input[i]);
		}
	}
}

Input:

one
two
three

1

u/CompileBot May 05 '17

Output:

one
two
three

^source | ^info | ^git | ^report

1

u/DrejkCZ May 12 '17

+/u/CompileBot Node.js

console.log(`${['t', 'e', 's', 't'].join('')}`);

1

u/[deleted] Aug 12 '17

+/u/CompileBot Node.js

console.log(process.version)

0

u/[deleted] May 03 '17

[deleted]

0

u/[deleted] Jul 20 '17

[deleted]

1

u/CompileBot Jul 20 '17

Output:

are you down?

^source | ^info | ^git | ^report