We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
CTFFuck2
Jump to navigation
Jump to search
CTFFuck2 is a circular-buffer and linear-memory-based language.
Syntax
CTFFuck2 interpreter will automatically skip any non-decimal characters, which means you can simply write as many comments as you want(Though we suggest that you should format it first before interpreting, so as to boost speed in the program with many jmpms!)
| Command | Stack Depth | Behaviour(in pseudo asm) |
|---|---|---|
| 0(read) | 1 | mov [arg1], [arg0]
|
| 1(add) | 1 | add [arg0], arg1
|
| 2(set) | 0 | xor [arg0], [arg0]
|
| 3(push) | 0 | push arg0
|
| 4(print) | 0 | print [arg0]
|
| 5(swap) | 1 | xchg [arg0], [arg1]
|
| 6(grow) | 1 | Choose from 0-5 using arg0, then caculate it with arg1 to generate a transposus
|
| 7(inp) | 0 | mov [arg0], stdin
|
| 8(jmpm) | 1 | Choose form 0-7 using arg0 to decide jump or not with flags, then jmp to $+[arg1]
|
| 9(revf) | 0 | reverse flag, decide on arg0 from 0-4
|
Memory
Memory is a int[10]:
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Conditional Jumping
Flag registries will be edited whenever an assignment occurs.
| Name | Default value | Meaning |
|---|---|---|
| zf | false | The assignment is target to zero |
| sf | false | The assignment is target to negative |
While that, special flag registries will only be changed by revf.
| Name | Default value | Meaning |
|---|---|---|
| cf | false | Customized flag. It doesn't have an offical meaning, so developers can use it on ABIs(For example, ACI) |
| _if | true | The interpreter will only operate command `inp` if _if is true
|
| of | true | The interpreter will only operate command `print` if of is true
|