996
|
1 /*
|
|
2 * Copyright (C) 2005 Gregor Richards
|
|
3 *
|
|
4 * This file is part of EgoBCh.
|
|
5 *
|
|
6 * EgoBCh is free software; you can redistribute it and/or modify
|
|
7 * it under the terms of the GNU General Public License as published by
|
|
8 * the Free Software Foundation; either version 2 of the License, or
|
|
9 * (at your option) any later version.
|
|
10 *
|
|
11 * EgoBCh is distributed in the hope that it will be useful,
|
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 * GNU General Public License for more details.
|
|
15 *
|
|
16 * You should have received a copy of the GNU General Public License
|
|
17 * along with EgoBCh; if not, write to the Free Software
|
|
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
19 */
|
|
20
|
|
21 /*
|
|
22 * Thanks to the kind people of #esoteric and http://www.esolangs.org/wiki/
|
|
23 * for making these translation tables.
|
|
24 */
|
|
25
|
|
26 #include <stdio.h>
|
|
27
|
|
28 int main()
|
|
29 {
|
|
30 int input;
|
|
31
|
|
32 while ((input = getchar()) != EOF) {
|
|
33 switch (input) {
|
|
34 case '+':
|
|
35 printf("}<}}<}}<}}<}}<}}<}}<}}<}[<]<}}<}[<}}<}]<<<<<<<<<[<}]\n");
|
|
36 break;
|
|
37
|
|
38 case '-':
|
|
39 printf("<}}<}}<}}<}}<}}<}}<}}<}}[<<}]}<}[}<}]<<<<<<<<<[<}]\n");
|
|
40 break;
|
|
41
|
|
42 case '>':
|
|
43 printf("}<}}<}}<}}<}}<}}<}}<}}<}}<}}<}\n");
|
|
44 break;
|
|
45
|
|
46 case '<':
|
|
47 printf("<<<<<<<<<<\n");
|
|
48 break;
|
|
49
|
|
50 case '[':
|
|
51 printf("<}[<} }<}}<}}<}}<}}<}}<}}<}}<}\n"
|
|
52 "[}<}<}<<<<<<<<<[<}]<}}<}}<}}<}}<}}<}}<}}<}}<}<}]}<}[<<}}<}<}]\n"
|
|
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
|
|
76 case ',':
|
|
77 printf("}<},<\n");
|
|
78 break;
|
|
79
|
|
80 case '#':
|
|
81 printf("#\n");
|
|
82 break;
|
|
83 }
|
|
84 }
|
|
85 return 0;
|
|
86 }
|