Line | |
---|
1 |
|
---|
2 | 2D Table reading routine for BrainFuck
|
---|
3 | Made By: NYYRIKKI 2001
|
---|
4 |
|
---|
5 | **************************************
|
---|
6 |
|
---|
7 | If you need memory allocate it *HERE*
|
---|
8 |
|
---|
9 | This address will be later called zero
|
---|
10 |
|
---|
11 | >>>>>>>>>>>+>>
|
---|
12 | Z
|
---|
13 | **************************
|
---|
14 | * Write tables to memory *
|
---|
15 | **************************
|
---|
16 | (Replace with own tables)
|
---|
17 |
|
---|
18 | Table 0
|
---|
19 | ++++>>++++>>+++++>>+++
|
---|
20 |
|
---|
21 | >>>>>>+>> (Table separator)
|
---|
22 | Table 1
|
---|
23 | ++>>+++>>++++
|
---|
24 |
|
---|
25 | >>>>>>+>>
|
---|
26 | Table 2
|
---|
27 | ++++>>+++>>++
|
---|
28 |
|
---|
29 | *****************
|
---|
30 | * End of tables *
|
---|
31 | *****************
|
---|
32 |
|
---|
33 | [[<<]<<<<]<<<<<
|
---|
34 |
|
---|
35 | ****************************************
|
---|
36 | * Parameter table (Fill with own code) *
|
---|
37 | ****************************************
|
---|
38 |
|
---|
39 | (We are in address zero Put your own code here)
|
---|
40 |
|
---|
41 | Read (Z=No NZ=Yes)
|
---|
42 | +
|
---|
43 |
|
---|
44 | > Table number (0 to 255)
|
---|
45 | ++
|
---|
46 |
|
---|
47 | > Address in table (1 to 255)
|
---|
48 | ++
|
---|
49 |
|
---|
50 | > Value (1 to 255)
|
---|
51 |
|
---|
52 | <<<
|
---|
53 | **************************
|
---|
54 | * End of Parameter table *
|
---|
55 | **************************
|
---|
56 |
|
---|
57 |
|
---|
58 | ********
|
---|
59 | * Code *
|
---|
60 | ********
|
---|
61 | [[-] Read Y/N
|
---|
62 |
|
---|
63 | Copy table
|
---|
64 | >[->>>+>>+<< <<<]>>>[-<<<+>>>]
|
---|
65 | Copy Address
|
---|
66 | <<[->>+>> >>>>+<<<< <<<<]>>[-<<+>>]
|
---|
67 | >>
|
---|
68 |
|
---|
69 | Goto table X
|
---|
70 | [-
|
---|
71 | >>>>
|
---|
72 | Move address number
|
---|
73 | [->[>>]>>>+<<< <<[<<]>]
|
---|
74 | Move table number
|
---|
75 | <<<<[-> >>>>[>>]<+<[<<]<<<]
|
---|
76 |
|
---|
77 | >>>>>[>>]<
|
---|
78 | ] End of goto
|
---|
79 |
|
---|
80 | >>>>
|
---|
81 |
|
---|
82 | Search address in current table
|
---|
83 |
|
---|
84 | [-[->>+<<]+>>]
|
---|
85 |
|
---|
86 | >
|
---|
87 | [-<+> >+<]
|
---|
88 |
|
---|
89 | >[-<+>]<
|
---|
90 | <
|
---|
91 | -
|
---|
92 | <<<<
|
---|
93 | [->>>>
|
---|
94 |
|
---|
95 | [-<<+>>]
|
---|
96 |
|
---|
97 | <<<<<<
|
---|
98 | ]
|
---|
99 | >>>>
|
---|
100 | [-<<+>>]<<
|
---|
101 |
|
---|
102 | Copy value to parameter table
|
---|
103 | >-<
|
---|
104 | [-
|
---|
105 | <<<<<
|
---|
106 | [[<<]<<<<]<<
|
---|
107 | +
|
---|
108 | >> >>>>>>
|
---|
109 | [[>>]>>>>]
|
---|
110 | <
|
---|
111 | ]
|
---|
112 | >+<
|
---|
113 | <<<<<[[<<]<<<<]<<<<<
|
---|
114 | ] End of Read Y/N
|
---|
115 |
|
---|
116 | ***************
|
---|
117 | * End of Code *
|
---|
118 | ***************
|
---|
119 |
|
---|
120 | Read = 0
|
---|
121 | Value = readed value
|
---|
122 | other parameters are not changed
|
---|
123 |
|
---|
124 | (We are in address zero Continue your code here)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.