source: trunk/Examples/Others/2d_table.bf

Last change on this file was 11, checked in by chronos, 12 years ago
  • Added: Some other examples from web.
File size: 1.6 KB
Line 
1
22D Table reading routine for BrainFuck
3 Made By: NYYRIKKI 2001
4
5**************************************
6
7If you need memory allocate it *HERE*
8
9This address will be later called zero
10
11>>>>>>>>>>>+>>
12Z
13**************************
14* Write tables to memory *
15**************************
16(Replace with own tables)
17
18Table 0
19++++>>++++>>+++++>>+++
20
21>>>>>>+>> (Table separator)
22Table 1
23++>>+++>>++++
24
25>>>>>>+>>
26Table 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
41Read (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
63Copy table
64>[->>>+>>+<< <<<]>>>[-<<<+>>>]
65Copy Address
66<<[->>+>> >>>>+<<<< <<<<]>>[-<<+>>]
67>>
68
69Goto table X
70[-
71>>>>
72Move address number
73[->[>>]>>>+<<< <<[<<]>]
74Move table number
75<<<<[-> >>>>[>>]<+<[<<]<<<]
76
77>>>>>[>>]<
78] End of goto
79
80>>>>
81
82Search address in current table
83
84[-[->>+<<]+>>]
85
86>
87[-<+> >+<]
88
89>[-<+>]<
90<
91-
92<<<<
93[->>>>
94
95[-<<+>>]
96
97<<<<<<
98]
99>>>>
100[-<<+>>]<<
101
102Copy 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
120Read = 0
121Value = readed value
122other 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.