Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXAMPLES:
- 'easy' example:
- 00101 ask for a string
- 1000110 get length of last thing in stack
- BINARY: 001011000110
- COMPILED: RX
- ____________________________________
- 'intermediate' example: (the things after the explatation are the contents of the data stack for the 1st repeat)
- 0001 000 make an empty string ""
- 0010 1 ask for str "", "asked"
- 1001 1110 capitalize asked "", "ASKED"
- 0100 1001 000 change popping rule "", "ASKED"
- 1000 110 get the length "", "ASKED", 5
- 0101 00 copy length "", "ASKED", 5, 5
- 1100 1 start repeat "", "ASKED", 5
- 1000 010 takes letter from asked "", "ASKED", 5, "D"
- 0110 10010 reorder to 1234 -> 2314 "ASKED", 5, "", "D"
- 0000 joins the last 2 "ASKED", 5, "D"
- 0110 00110 reorder to 1234 -> 1423 "D", "ASKED", 5
- 0001 001 00 adds a -1 to stack "D", "ASKED", 5, -1
- 0000 adds -1 to the count "D", "ASKED", 4
- 1100 0 end repeat
- 0110 00011 1234 -> 1342
- in one line:
- 0001000 00101 10011110 01001001000 1000110 010100 11001 1000 010 0110 10010 0000 0110 00110 0001 001 00 0000 11000 0110 00011
- BYTES: 000100000101100111100100100100010001100101001100110000100110100100000011000110000100100000011000011000011
- COMPILED: }.;>Jpvu3n!'7sw$
- V2 code: d%GDD1j9b:0,82!Ac
- ____________________________________
- HARD CHALLENGE: (currently in making)
- LINE CODE EXPLATATION 1st ITIRATION DATASTACK
- 1 0001 011 0000001000000000 adds 512 to stack 512
- 2 0101 00 clones the 512 512, 512
- 3 0001 001 11 adds 10 to stack 512, 512, 10
- 4 0100 0000 101 changes the pop rule to pop the S-2 512, 512, 10
- 5 1100 1 start a repeat 512, 512
- 6 1001 0011 bitshiftleft the last thing in stack 512, 256
- 7 0010 1 asks for a string 512, 256, "lower" (or whatever you inputted)
- 8 0001 001 01 adds 1 to stack 512, 256, "lower", 1
- 9 1000 010 gets the 1st letter from your input 512, 256, "l"
- 10 0001 101 1001100 add "l" to stack 512, 256, "l", "l"
- 11 1001 1010 compares the 2. 512, 256, 1 (if what you wrote in starts with "l")
- 12 0001 010 00010001 adds the line to jump to (line 17) 512, 256, 1, 00010001
- 13 1111 jump if what you wrote starts with "l" 512, 256
- 14 0000 adds the last 2 leaving the S-1 256, 768 (if what you wrote was "higher")
- 15 0001 010 11111111 adds the line to jump to (line xx) 256, 768, 11111111
- 16 1110 jumps to line xx
- 17
- 18
- 19
- 20
- idk 1100 0 end the repeat
- ____________________________________
- prints out a=258, inputs being a=, 255, 3
- 0001110 01100000111100 input 14byte string in stack it being base95 for "a="
- 0001010 11111111 add to stack 255
- 0001010 00000011 add to stack 3
- 0000 add last 2, them being 3 and 255. Results in 258
- 0000 add last 2 them being "a=" and 258 resulting in "a=258"
- BYTES: 00011100110000011110000010101111111100010100000001100000000
- COMPILED: !!^$BWB`D+
- ____________________________________
- takes 2 inputs and adds them & adds a "a=" at the start
- 0001110 01100000111100 input 14byte string in stack it being base95 for "a="
- 00100 input 1
- 00100 input 2
- 0000 adds what you wrote in
- 0000 adds "a=" with the sum
- BYTES: 000111001100000111100001000010000000000
- COMPILED: o"h1SW
- _________________
- to take 2 inputs and add them:
- 0000 ADD; if add doesn't have any inputs, it asks for an input and puts 2 of them in the datastack. We'll ignore the 1st one.
- 0010 0 asks for a number
- 0000 adds them
- BYTES: 0000001000000
- COMPILED: "vv"
- _________________
- ____________________________________
- multiply by using only +1 and repeat in repeat:
- 0010 0
- 0101 11
- 0010 0
- 1100 1
- 0101 01
- 1100 1
- 0001 001 01
- 0000
- 1100 0
- 1100 0
- BYTES: 0010 0 0101 11 0010 0 1100 1 0101 01 1100 1 0001 001 01 0000 1100 0 1100 0
- 0010001011100100110010101011100100010010100001100011000
- COMPILED: 8`||@@iVM
- ____________________________________
- an old challenge to get the number 2007 without literals (for bytt - not using the function 0001 in the binary code)
- CODE DATASTACK EXPLANATION
- 1001 0000 1 gets COS(nothing) which equals 1
- 0000 2 adds the last 2 but as there aren't 2, adds to self
- 0000 4 adds the last 2 but as there aren't 2, adds to self
- 1000 001 16 multiplies last 2 but as there aren't 2, multiples to self (aka ^2)
- 0000 32 adds the last 2 but as there aren't 2, adds to self
- 1000 001 1024 multiplies last 2 but as there aren't 2, multiples to self (aka ^2)
- 0000 2048 adds the last 2 but as there aren't 2, adds to self
- 1000 100 2048, 45.25... takes the sqrt of 2048
- 1001 1000 2048, 45.25, 1 gets the sign of 45.25...
- 0101 00 2048, 45.25, 1, 1 duplicates the 1
- 0000 2048, 45.25, 2 adds the last 2
- 0101 00 2048, 45.25, 2, 2 duplicates the 2
- 0000 2048, 45.25, 4 adds the last 2
- 0110 00010 2048, 4, 45.25 swaps the last 2 places
- 1001 1111 2048, -41.25 substracts last 2
- 0000 2006.74.... adds last 2
- 1000 000 2007 rounds last
- ONE LINE: 1001 0000 0000 0000 1000 001 0000 1000 001 0000 1000 100 1001 1000 0101 00 0000 0101 00 0000 0110 00010 1001 1111 0000 1000 000
- BYTES: 10010000000000001000001000010000010000100010010011000010100000001010000000110000101001111100001000000
- COMPILED: (T=Aju1hkGQV<)r2
- V2 code: !D ""$$(ib`4!bGP`
- UPDATE: it now asks to input a number, input 0. This is because i'm implementing implicit input more and more.
- ____________________________________
- counts to 20
- 0101 00 normally clones last but as last is nothing, adds num 0 to stack.
- 0001 010 00010100 adds 20 to stack
- 1100 1 starts a repeat
- 0001 001 10 adds a 1 to stack
- 0000 adds the last 2
- 0101 00 clones last
- 0001 001 10 adds a 1 to stack
- 0111 pushes S-1 things to console
- 1100 0 ends repeat
- BYTES: 010111000101000010100110010001001100000010100000100110011111000
- COMPILED: 3vZWp~Y>_D
- ____________________________________
- write inputted string x times
- 0010 0 stacks a number input
- 0001 001 10 stacks the number 1
- 0000 add S-1 and S-2
- 0010 1 stacks a string input
- 0111 pushes S-2 things from the stack to CONSOLE joined with S-1
- ____________________________________
- some other examples (mainly from other language examples) (if you want an explanation, use the F menu to decompile the code and prettify it)
- the |s show below from where to where to copy code
- | |
- |"dTS| prints "hi"
- | |
- |}z%'qFy]P| prints "hi" 100 times
- | |
- |>S{%M| is a legitly done forever CAT program, " is the shortProg of it
- | |
- |JB+^*Wg}| counts forever. Fills up stack with all the numbers in order to save 6 bytes :p
- | |
- |!#a| negates a number
- |
- |
- ____________________________________
- new challenges:
- the |s show below from where to where to copy code
- SIMPLE:
- | |
- |<S)FK&|1\| counts from 1 to 10
- _______________
- 0001 011 0000000100000000 stacks a 16-bit number 256
- 0010 0 stacks a number input
- 1000 001 multiply 256*input
- 0010 0 stacks a number input
- 0000 add the multiplication and input
- 0001 011 0000000100000000 stacks a 16-bit number 256
- 1000 001 multiply 256*last thing
- 0010 0 stacks a number input
- 0000 add last thing & input
- BYTES: 00010110000000100000000001001000001001000000000101100000001000000001000001001000000
- COMPILED: 3INVbS>X 4}<\
- ____________________________________
- INTERMEDIATE:
- 000111100010010101001000111111111110001000111000
- 1101 0 000 "chuck"
- 000111100001100100011111010010110000101101
- 1101 0 001 "wood"
- 000111100010010110101010011101000011101101110101
- 1101 0 011 "would"
- 1101 1 001 "wood"
- 1101 1 000 "chuck"
- 0000 "woodchuck"
- 1101 0 100 "woodchuck"
- 0001111001001011010001000011111011100001011011101001010111000111101 "How much"
- 1101 1 001 "wood"
- 1101 1 011 "would"
- 00011011000001 "a"
- 1101 1 100 "woodchuck"
- 1101 1 000 "chuck"
- 00011110000101111110001001010100111011110 "if a"
- 1101 1 100 "woodchuck"
- 000111100010010101001001010110110111100101100001 "could"
- 1101 1 000 "chuck"
- 1101 1 001 "wood"
- 00011010011111 "?"
- 0000
- 0001 010 00001011 push last 11 things
- 0111 push
- 00011010100001 "A"
- 1101 1 100 "woodchuck"
- 1101 1 011 "would"
- 1101 1 000 "chuck"
- 00101 ASK
- 0001 010 00000101 push last 6 things
- 0111 push
- BYTES: 00011110001001010100100011111111111000100011100011010000000111100001100100011111010010110000101101110100010001111000100101101010100111010000111011011101011101001111011001110110000000110101000001111001001011010001000011111011100001011011101001010111000111101110110011101101100011011000001110111001101100000011110000101111110001001010100111011110110111000001111000100101010010010101101101111001011000011101100011011001000110100111110000000101000001011011100011010100001110111001101101111011000001010001010000001010111
- COMPILED: &TG%8/14#GYomP+{/'entZzMgLC6,I/Hb`J'XC;XBU2@d-K25u m.z\sF]t<J#d2X?3+Gi_ssLa|T0a
- V2 CODE: gdJ1_\1QH#PR/rPMT1XEJnc{KsV=`:@\EHA]PMTKg}nV-@[m`\+\2IW{aXjDvWEcxV1sX"@MQt.Y{V"B`w
- ____________________________________
- HARD:
- bracket test:
- 0001000 adds an empty string
- 0010 1 input string
- 1000 110 get lenght
- 1100 1 start repeat
- 1000 101 gets the last char from user input
- 1101 0 000 sets var 0 to current char
- 1101 1 000 loads var 0
- 0110 00100 swaps the answer and bracketstack
- 00011010001001 ")"
- 1000 001 tests if ")" != current char
- 000101000001111 jump line
- 1111 jumps if test was false
- 00011010001000 "("
- 0000 add last 2
- 1101 1 000 loads var 0
- 00011010111101 "]"
- 1000 001 tests if ")" != current char
- 000101000010110 jump line
- 1111 jumps if test was false
- 00011010111011 "["
- 0000 add last 2
- 1101 1 000 loads var 0
- 00011010001000 "("
- 1000 001 tests if "(" != current char
- 000101000100010 jump line
- 1111 jumps if test was false
- 1000 101 gets the last char from backetstack
- 1101 1 000 loads var 0
- 1001 1010 tests if the bracket matches what it should match
- 000101000100010 jump line
- 1111 jumpIf
- 000100101 stack 0
- 1011 EXIT
- 1101 1 000 loads var 0
- 00011010111011 "["
- 1000 001 tests if "[" != current char
- 000101000101110 jump line
- 1111 jumps if test was false
- 1000 101 gets the last char from backetstack
- 1101 1 000 loads var 0
- 1001 1010 tests if the bracket matches what it should match
- 000101000101110 jump line
- 1111 jumpIf
- 000100101 stack 0
- 1011 EXIT
- 0110 00010 swaps the answer and bracketstack
- 1100 0 ends repeat
- 0110 00010 swaps the answer and bracketstack back
- 0001 000 adds an empty string
- 1000 001 if both are not equal add 1
- 000101000110111 line 55
- 1111 jumpIf
- 0001 001 10 stack num 1
- 1011 EXIT
- 000100101 stack 0
- BYTES:00010000010110001101100110001011101000011011000011000100000110100010011000001000101000001111111100011010001000000011011000000110101111011000001000101000010110111100011010111011000011011000000110100010001000001000101000100010111110001011101100010011010000101000100010111100010010110111101100000011010111011100000100010100010111011111000101110110001001101000010100010111011110001001011011011000010110000110000100001000100000100010100011011111110001001101011000100101
- COMPILED: 2C=4R6@?myhC\,<@ofQY#@[E3fbi/4c,!0a%x>H-;N S1;PS?z=lwQp!Cx-DeGPy}OxE|D}
- V2 CODE: (@xV8NAL,0:)@B@_QH@-@:]@BbWf}Ax&B((HB^+xFbd7d{V!KN"*+OeV)pH}XEMbPPb((qOXFxE
- _______________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement