Advertisement
Tritonio

Brainfuck Array Wizard

Jul 23rd, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.90 KB | None | 0 0
  1. Brainfuck Array Wizard by Tritonio
  2.  
  3. How many bytes per cell? 2
  4. How many cells? 1000000000
  5.  
  6. This is the structure of the table: 00IIIIDD0000(2000000000 empty cells for array data)
  7. (0 stands for empty cell, I for index, D for data)
  8. (The most significant index is the first one)
  9.  
  10. The total size of the table is 2000000012.
  11. The overhead because of the indexes etc is 0% of the total size.
  12.  
  13. To write to the table fill in the I (index) and the D (data) positions in the header, move the Brainfuck pointer to the beginning of the structure and execute the following code:
  14. >>>>>[->>>>>>+>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>]<[->>>>>>+>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>-[->>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>]<]<[->>>>>>+>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>-[->>>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>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>>>>>+<<<<<<<<<<<<]<[->>>>>>>>>>>>+<<<<<<<<<<<<]>>>>>>>>>>>]<]<]<]<<<<<<<<
  15. After the execution, the indexes and the data fields will be zeroed and the Brainfuck pointer will be left at the beginning of the structure.
  16.  
  17. To read from the table fill the I (index) fields, move the Brainfuck pointer to the beginning of the structure and execute the following code:
  18. >>>>>[->>>>>>+>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<<<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>]<[->>>>>>+>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<<<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>-[->>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<<<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>]<]<[->>>>>>+>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<<<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>-[->>>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<<<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>-[->>>>>>>>[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[-<<<<<<<<<<<<+>>>>>>>>>>>>]<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]<<<[->>+<<]<[->>+<<]<[->>+<<]<[->>+<<]>>>>>]<]<]<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<[->>>>>>>>>>>>+<<<<<<<<<<<<]<[->>>>>>>>>>>>+<<<<<<<<<<<<]>>>>>>>>>>>]<]<]<]<<<<<<<<
  19. After the execution, the indexes will be zeroed, the Brainfuck pointer will be left at the beginning of the structure and the data fields will contain the read data.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement