view interps/egobch/src/bf2bch.c @ 6558:4ad4b893c806

<b_jonas> learn links are one of the very few HTML renderers that don\'t try to store a full document tree with heavyweight objects for each node just in case javascript wants to modify it later, so it\'s the only engine that can render those HTMLs that are automatically converted from a PDF and put each letter to a separate element.
author HackBot
date Thu, 14 Jan 2016 11:54:35 +0000
parents 859f9b4339e6
children
line wrap: on
line source

/*
 * Copyright (C) 2005  Gregor Richards
 *
 * This file is part of EgoBCh.
 * 
 * EgoBCh is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * EgoBCh is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with EgoBCh; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/*
 * Thanks to the kind people of #esoteric and http://www.esolangs.org/wiki/
 * for making these translation tables.
 */

#include <stdio.h>

int main()
{
    int input;
    
    while ((input = getchar()) != EOF) {
        switch (input) {
            case '+':
                printf("}<}}<}}<}}<}}<}}<}}<}}<}[<]<}}<}[<}}<}]<<<<<<<<<[<}]\n");
                break;
                
            case '-':
                printf("<}}<}}<}}<}}<}}<}}<}}<}}[<<}]}<}[}<}]<<<<<<<<<[<}]\n");
                break;
                
            case '>':
                printf("}<}}<}}<}}<}}<}}<}}<}}<}}<}}<}\n");
                break;
                
            case '<':
                printf("<<<<<<<<<<\n");
                break;
                
            case '[':
                printf("<}[<} }<}}<}}<}}<}}<}}<}}<}}<}\n"
                       "[}<}<}<<<<<<<<<[<}]<}}<}}<}}<}}<}}<}}<}}<}}<}<}]}<}[<<}}<}<}]\n"
                       "<<[}<}}<}<}<<<<<<<<<[<}]<}}<}}<}}<}}<}}<}}<}}<}<}]}<}}<}[<<<}}<}}<}<}]\n"
                       "<<<[}<}}<}}<}<}<<<<<<<<<[<}]<}}<}}<}}<}}<}}<}}<}<}]}<}}<}}<}[<<<<}}<}}<}}<}<}]\n"
                       "<<<<[}<}}<}}<}}<}<}<<<<<<<<<[<}]<}}<}}<}}<}}<}}<}<}]}<}}<}}<}}<}[<<<<<}}<}}<}}<}\n"
                       "}<}<}]\n"
                       "<<<<<[}<}}<}}<}}<}}<}<}<<<<<<<<<[<}]<}}<}}<}}<}}<}<}]}<}}<}}<}}<}}<}[<<<<<<}}<}}\n"
                       "<}}<}}<}}<}<}]\n"
                       "<<<<<<[}<}}<}}<}}<}}<}}<}<}<<<<<<<<<[<}]<}}<}}<}}<}<}]}<}}<}}<}}<}}<}}<}[<<<<<<<\n"
                       "}}<}}<}}<}}<}}<}}<}<}]\n"
                       "<<<<<<<[}<}}<}}<}}<}}<}}<}}<}<}<<<<<<<<<[<}]<}}<}}<}<}]}<}}<}}<}}<}}<}}<}}<}[<<<\n"
                       "<<<<<}}<}}<}}<}}<}}<}}<}}<}<}]\n"
                       "<<<<<<<<[}<}}<}}<}}<}}<}}<}}<}}<}<}<<<<<<<<<[<}]<}}<}<}]}<}}<}}<}}<}}<}}<}}<}}<}\n"
                       "[<<<<<<<<<}}<}}<}}<}}<}}<}}<}}<}}<}<}] <<<<<<<<<[<}\n");
                break;
                
            case ']':
                printf("}<}}<}}<}}<}}<}}<}}<}}<}}<}<}<<<<<<<<<]}<}}<}}<}}<}}<}}<}}<}}<}}<}[<<<<<<<<<<}}<\n"
                       "}}<}}<}}<}}<}}<}}<}}<}}<}<}]<<<<<<<<<]\n");
                break;
                
            case '.':
                printf("}<}.<\n");
                break;
                
            case ',':
                printf("}<},<\n");
                break;

            case '#':
                printf("#\n");
                break;
        }
    }
    return 0;
}