diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/ok_sample.tpc | 8 | ||||
-rw-r--r-- | res/test_array.tpc | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/res/ok_sample.tpc b/res/ok_sample.tpc index 7b56e7f..e27e86a 100644 --- a/res/ok_sample.tpc +++ b/res/ok_sample.tpc | |||
@@ -6,19 +6,17 @@ | |||
6 | 6 | ||
7 | const special = 'b'; | 7 | const special = 'b'; |
8 | 8 | ||
9 | caractere funky_func(entier arg) { | 9 | entier funky_func(entier arg) { |
10 | return !arg; | 10 | return !arg; |
11 | } | 11 | } |
12 | 12 | ||
13 | void main(void) { | 13 | void main(void) { |
14 | caractere ret; | 14 | entier ret; |
15 | ret = 1 + funky_func(0) * 2; | 15 | ret = 1 + funky_func(0) * 2; |
16 | 16 | ||
17 | while (ret) { | 17 | while (ret) { |
18 | readc(ret); | 18 | reade(ret); |
19 | print(ret); | 19 | print(ret); |
20 | |||
21 | if (ret == special) print('!'); | ||
22 | } | 20 | } |
23 | } | 21 | } |
24 | 22 | ||
diff --git a/res/test_array.tpc b/res/test_array.tpc new file mode 100644 index 0000000..a968c22 --- /dev/null +++ b/res/test_array.tpc | |||
@@ -0,0 +1,10 @@ | |||
1 | entier tab[5]; | ||
2 | |||
3 | entier main(void) { | ||
4 | tab[1]=3; | ||
5 | tab[2]=22; | ||
6 | print(tab[2]+tab[1]); | ||
7 | print(tab[1]); | ||
8 | print(tab[2]); | ||
9 | return 0; | ||
10 | } | ||