SPIKE
Jump to navigation
Jump to search
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
Designed by | User:Ractangle |
---|---|
Appeared in | 2024 |
Computational class | Unknown |
Reference implementation | Unimplemented |
File extension(s) | .spik |
SPIKE is just ><> but harder. Mostly
Commands
Command | It's action |
---|---|
> | Makes the cursor move forwards. |
< | Makes the cursor move backwards. |
^ | Makes the cursor move up. |
v | Makes the cursor move down. |
? | Goes either forwards, backwards, up or down. |
_ | Ends the program. |
! | If the current value on the stack is 0 (or has the same value as the previous value), it goes forwards by 1 step. If it's not, it goes backwards by 1 step. If you want to check the previous value on the stack by typing ¡
|
x | Pop the recent value on the stack. |
0-9 | Adds numbers in the position of the cursor to the stack. |
a, s, m, d | Math operators. |
o, n | Pop and output as a character/number and pops the outputed character/number. |
i | Pauses the operation and gets user input. |
f | Flips the stack. |
" | Anything inside the "" will be pushed into the stack as numbers |
# | Comments |
s | Pops two values and pushes the corresponding value to the postion of the second value (the starting value position is 1) |
c | Duplicates the current value on the stack |
/, \, |, - | Mirrors the direction of the cursor. |
SPIKE errors
- If you manage to let the Fish swim away from the code area. The interpreter will say "The fish has now left the code area"
- If you make ONE of the values in the stack higher than 256 or lower than 0. The interpreter will say "I have eaten a deadfish once" (which means that interpreter is deadfish inspired)
Interpriter test cases
319a1amo_
Should print "!"
>v ^<
Should make the fish get stuck in a infinate loop
12foo_
Should put 1, 2 onto the stack, flip the stack and output the values of the stack
Examples
Hello, world!
this is the shortest Hello, world! program possible as of writing this
"Hello, world!"01so¡0_
Number Guessing
vvvvvvv >???????< >?1?2?3?< >???????< _ >?4?5?6?< o >???????< " >?7?8?9?< y >???????< v!" >>>>v<<<< "i n " o >0fa!fxf>^