WCDA
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
Comment only
 
 
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
S
wcda.stack=[];
Sets the integer stack to an empty array.
2
+
wcda.stack.push(wcda.stack.pop()+wcda.stack.pop());
Pops A, B, pushes B+A
3
-
wcda.stack.push((0-wcda.stack.pop())+wcda.stack.pop());
Pops A, B, pushes B-A
4
*
wcda.stack.push(wcda.stack.pop()*wcda.stack.pop());
Pops A, B, pushes B*A
5
/
let temp=wcda.stack.pop();wcda.stack.push(Math.floor(wcda.stack.pop()/temp));
Pops A, B, pushes floor(A/B)
6
%
let temp=wcda.stack.pop();wcda.stack.push(wcda.stack.pop%temp);
Pops A, B, pushes B%A
7
:
let temp=wcda.stack.pop();wcda.stack.push(temp);wcda.stack.push(temp);
Duplicates the top element of the stack
8
\
let a=wcda.stack.pop();let b=wcda.stack.pop();wcda.stack.push(a);wcda.stack.push(b);
Swaps the top two elements of the stack
9
p
wcda.stack.push(program[pos+jmp]);pos+=jmp;
Pushes the codepoint of the next character to the stack (next char is ignored)
10
P
wcda.a = wcda.stack.pop();
Pops a value into the general purpose register a
11
0
wcda.stack.push(0);
Pushes 0
12
1
wcda.stack.push(1);
Pushes 1
13
2
wcda.stack.push(2);
Pushes 2
14
3
wcda.stack.push(3);
Pushes 3
15
4
wcda.stack.push(4);
Pushes 4
16
5
wcda.stack.push(5);
Pushes 5
17
6
wcda.stack.push(6);
Pushes 6
18
7
wcda.stack.push(7);
Pushes 7
19
8
wcda.stack.push(8);
Pushes 8
20
9
wcda.stack.push(9);
Pushes 9
21
j
pos=wcda.stack.pop()-jmp;
Pops A, sets program pointer to A
22
=
if(wcda.stack.pop()===wcda.stack.pop())pos=wcda.stack.pop()-jmp;else wcda.stack.pop();
Pops A, Pops B, Pops POS. If a = b, jumps to POS.
23
>
if(wcda.stack.pop()>wcda.stack.pop())pos=wcda.stack.pop()-jmp;else wcda.stack.pop();
Pops A, Pops B, Pops POS. If a > b, jumps to POS.
24
<
if(wcda.stack.pop()<wcda.stack.pop())pos=wcda.stack.pop()-jmp;else wcda.stack.pop();
Pops A, Pops B, Pops POS. If a < b, jumps to POS.
25
if(wcda.stack.pop()!==wcda.stack.pop())pos=wcda.stack.pop()-jmp;else wcda.stack.pop();
Pops A, Pops B, Pops POS. If a ≠ b, jumps to POS.
26
"
wcda.str="";
Sets the variable str to an empty string
27
'
wcda.strs=[];
Clears/Initializes the array of strings
28
wcda.strs[wcda.stack.pop]=wcda.str;
Pops POS, sets strs[POS] (string at pos POS in strs array) to str (NOTE: NOT A COMMA, DIFFERENT SYMBOL)
29
wcda.str+=wcda.strs[wcda.stack.pop()];
Pops POS, appends strs[POS] to str
30
wcda.str+=wcda.stack.pop();
Pops A, appends A to the str variable (as int)
31
wcda.str+=String.fromCodePoint(wcda.stack.pop());
Pops A, appends A to the str variable (as Unicode codepoint)
32
`
wcda.str=wcda.str.split("");wcda.stack.push(wcda.str.pop().codePointAt(0));wcda.str=wcda.str.join("");
Str -> Array, pushes codepoint of str.pop() to the stack, str -> string
33
for(var i=pos+jmp;;i+=jmp){if(program[i]===undefined||program[i]===8221){pos=i;break;}wcda.str+=String.fromCodePoint(program[i]);}
Appends all characters up to a ” to the str variable. Jumps to the ”.
34
//should never happen
End of “
35
I
wcda.str+=read.question(">");
Sets variable str to one line of console input
36
O
console.log(wcda.str);
Outputs variable str
37
J
wcda.str = eval(wcda.str);
Runs variable str as javascript, replaces str with the return value of the javascript
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...
 
 
 
Commands
 
 
Main menu