Files
BFInterpreter/test/tictactoe.bf

52 lines
1.7 KiB
Brainfuck

[tictactoe.b -- play tic-tac-toe
(c) 2020 Daniel B. Cristofani
http://brainfuck.org/
This program is licensed under a Creative Commons Attribution-ShareAlike 4.0
International License (http://creativecommons.org/licenses/by-sa/4.0/).]
--->--->>>>->->->>>>>-->>>>>>>>>>>>>>>>>>+>>++++++++++[
<<++[
--<+<<+<<+>>>>[
>[<->>+++>>[-]+++<<<+[<++>>+<--]]+>+++++[>>+++++++++<<-]
>>++++.[-]>>+[<<<<+>>+>>-]<<<<<<[>+<-]<<
]++++++++++.[-]>++
]-->>[-->[-]>]<<[
>>--[
-[
-[
-----[>+>+++++++<<+]-->>-.----->,[<->-]<[[<]+[->>]<-]<[<<,[-]]>>>>
]>
]<[
>-[+<+++]+<+++[+[---->]+<<<<<<[>>]<[-]]
>[<+[---->]++[<]<[>]>[[>]+>+++++++++<<-[<]]]>[>>>>]
]<[
-[[>+>+<<-]>[<+>-]++>+>>]<[<<++[-->>[-]]>[[-]>[<<+>>-]>]]
]<[
[[<<]-[>>]<+<-]>[-<+]<<[<<]-<[>[+>>]>[>]>[-]]
>[[+>>]<-->>[>]+>>>]
]<[
-[
--[+<<<<--[+>[-]>[<<+>+>-]<<[>>+<<-]]++[>]]
<<[>+>+<<-]>--[<+>-]++>>>
]<[<<<[-]+++>[-]>[<+>>>+<<-]+>>>]
]<[
+[[<]<<[<<]-<->>+>[>>]>[>]<-]+[-<+]<++[[>+<-]++<[<<->>+]<++]<
<<<<<< +> > >+> > >+[
<<< ->+>+>+[
<<<<<<< +>->+> > >->->+[
<<<<< ->+>+> >+>+[
<<<< ->->+>->+[
<<<<<<<<+>-> >+> > >->+>+[
<<<<< -> >+> >->+[
<<<< +>->+> >+]]]]]]]
+++[[>+<-]<+++]--->>[-[<->-]<++>>]++[[<->-]>>]>[>]
]<
]
]<
]
[This program plays tic-tac-toe. I've given it the first move. It needs
interactive i/o, e.g. a command-line brainfuck interpreter or a brainfuck
compiler that produces command-line executables. At the '>' prompt, enter
the number of an empty space, followed by a linefeed, to play a move there.]