Collection of tictactoe games written in different languages.
Simple tictactoe game with Python.
Run and test with:
python tictactoe_python
coverage run -m pytest
coverage report -m
coverage html
Simple tictactoe game with JavaScript.
Hosted here on AWS.
Simple tictactoe game with C++.
To build, test and run:
cmake -S . -B build
cmake --build build
cd build && ctest
cd .. && ./bin/tictactoe
Simple tictactoe game with Rust.
To build, test and run:
cargo build
cargo test
cargo run
Simple tictactoe game with Haskell.
To build, test and run:
cabal build
cabal test --enable-coverage
cabal run
Simple tictactoe game with Go.
To build, test and run:
go build
go test -covermode=count -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
go test -fuzz=FuzzSwapPlayer -fuzztime 30s
go test -fuzz=FuzzGetEmptyCells -fuzztime 30s
go test -fuzz=FuzzRandomMove -fuzztime 30s
go test -fuzz=FuzzMinMax -fuzztime 60s
go run tictactoe_go.go
Simple tictactoe game with Java.
To install, test and run:
mvn package
mvn test
java -jar target/tictactoe-0.1.0.jar
Simple tictactoe game with Ruby.
To build and test run:
gem build tictactoe_ruby.gemspec
bundle install
gem install tictactoe_ruby
bundle exec rake
./bin/tictactoeRuby
Simple tictactoe game with Ada.
To build and run:
alr build --validation
./bin/tictactoe_ada.exe
Simple two player tictactoe game with Generic.
To run and test:
generic tictactoe_generic.gen
generic tests/test_tictactoe.gen
Simple tictactoe app with Kotlin.
To run and test:
./gradlew build
./gradlew test
./gradlew connectedCheck
Simple tictactoe game with Swift.
To build and test:
swift build
swift test
Simple tictactoe game with Lua.
To test and run:
lua54 tests/test_tictactoe.lua
lua54 tictactoe_lua.lua
Simple tictactoe app with Dart using Flutter. Targeted towards Windows.
To build and test:
flutter build windows
flutter test
Simple tictactoe game with Zig.
To build and test:
zig build install
zig build test
Simple tictactoe game with Prolog.
Specifically SWI-Prolog.
To run and test:
swipl -g main -t halt tictactoe_prolog.pl
swipl -g run_tests -t halt tictactoe_prolog_test.pl
Simple tictactoe game with Common Lisp.
In the repl run:
(load "D:/Programming/Projects/TicTacToe/TicTacToe/tictactoe_common-lisp/tictactoe_common-lisp.asd")
(ql:quickload :tictactoe_common-lisp)
(ql:quickload :fiveam)
To compile, run and test:
sbcl.exe --core C:\\lispstick\\Steel\ Bank\ Common\ Lisp\\1.1.12\\sbcl.core --eval "(let ((warning (nth-value 1 (compile-file \"src/tictactoe_common-lisp.lisp\")))) (if warning (sb-ext:exit :code 1) (sb-ext:exit)))"
sbcl.exe --core C:\\lispstick\\Steel\ Bank\ Common\ Lisp\\1.1.12\\sbcl.core --load src/tictactoe_common-lisp.lisp --eval '(progn (tictactoe_common-lisp:play) (sb-ext:quit))'
sbcl.exe --core C:\\lispstick\\Steel\ Bank\ Common\ Lisp\\1.1.12\\sbcl.core --non-interactive --load run-tests.lisp
Simple tictactoe game with C.
AI player settings via command line.
Also creates Python bindings and gives an example of how to use them.
To compile and run:
make
./bin/tictactoe_c -X 0
Simple version with 2 player in Smalltalk.
To run in Squeak once installed:
Game new playGame.
Simple version with (currently) 2 players in Fortran.
To compile and run:
make
./bin/tictactoe.exe
Simple version with 2 players in x86 Assembly. Uses NASM.
To compile and run:
make
Simple version with 2 players in Brainfuck.
Useful sites to run and debug:
https://kvbc.github.io/bf-ide/
To run use any brainfuck interpreter. Example using brainfuck-exe:
cargo install brainfuck-exe
brainfuck -f tictactoe.bf --print-info
Game written in GnuCobol. No minmax algorithm as highest PC strength as recursion seems annoying.
To compile and run:
cobc -x tictactoe_cobol.cob
./tictactoe_cobol
Depending on the setup first run ./set_env.cmd
.
Version with Julia.
To test and run:
julia --project=. test/runtests.jl
julia --project=. test/runexample.jl -X 3 -O 3
Version using PHP.
To test and run:
phpunit --testdox tests
php tests/runTicTacToe.php -X 4 -O 4
Version using Nim.
To compile, test and run:
nimble build
nimble test
./tictactoe_nim --X=4 --O=4
Version using C#.
To compile and run:
dotnet build Tictactoe.Lib
dotnet test Tictactoe.Tests
cd Tictactoe.Prog
dotnet run -- -X 4 -O 4
Version using Perl.
To run:
perl tictactoe.pl -X 4 -O 4
Version using Nix.
This one is only the PC playing against itself with hard coded strength settings.
nix-instantiate --eval tictactoe.nix --read-write-mode | xargs printf "%b"
Version using Bash.
Run with:
./tictactoe_bash.sh 4 4
Version using Basic.
Compile and run with:
fbc tictactoe_basic.bas
./tictactoe_basic 4 4
Version using Clojure.
Run:
clj -M tictactoe.clj 4 4
Version using ClojureScript.
Run and go to localhost:9000
:
clj -M --main cljs.main --compile tictactoe.core --repl
Version using CoffeeScript.
Run with:
coffee tictactoe.coffee
Version using Crystal.
Test and run with:
crystal spec
crystal run src/tictactoe_crystal.cr -- --X-strength=4 --O-strength=4
Version using D.
Test and run with:
dub test
dub run -- --X-strength=4 --O-strength=4
Version using LibertyEiffel.
Test and run with:
se test tests
se c -style_warning -all_check TICTACTOE make -o tictactoe
./tictactoe --x-strength=4 --o-strength=4
se c -style_warning -no_check TICTACTOE make -o tictactoe
./tictactoe --x-strength=5 --o-strength=5
Version using Elixir.
Test and run with:
mix test --no-start
mix run -- --x-strength 4 --o-strength 4
Minimal two player version using Elm.
Hosted here on AWS.
Compile with:
elm make src/Main.elm
Version using Erlang.
Run with:
erlc tictactoe.erl
escript tictactoe.escript 4 4
Version using F#.
To compile and run:
dotnet build
dotnet run -- -X 4 -O 4
Version using Pascal, specifically FreePascal.
To build and run:
lazbuild tictactoe.lpi
./tictactoe
Version using Turnstyle.
Written as lambda expression, then compiled with turnstyle cabal run turnstyle compile -O tictactoe.txt --output tictactoe.png
and finally hand optimized.
Does not handle invalid (out-of-bounds or overwriting) inputs.
Run with:
cabal run turnstyle run tictactoe.png
Version using Tcl.
Run with:
tclsh tictactoe.tcl
Version using Piet.
Developed using MasterPiets, Pietron and piet_programming_language.
Logic of the individual components is defined in PietLogic.txt.
Run with:
piet_programming_language tictactoe.png
Version in INTERCAL, specifically using C-INTERCAL.
Adopted from BoundedBeans.
Compile and run with:
ick -Ofb tictactoe.i
./tictactoe
Version using Shakespeare, specifically shakespearelang.
Run with:
shakespeare run tictactoe.spl
Version in Chef, specifically using rchef.
Run using:
rchef tictactoe.chef
Version using the perfect programming language.
Makes use of the implementation by vivaansinghvi07.
Run with:
dreamberd tictactoe.db
Version using Mojo.
Build, test and run with:
mojo build main.🔥
mojo test -I . test
./main
Very simple two player tictactoe game with Scratch.
To play load it on the Scratch website
Analog version leveraging the quantum properties of light using polarization filters.
To get and play:
./get_bachelor_of_science_degree_in_physics
./get_master_of_science_degree_in_physics
./study_polarization_of_WZ_bosons
./get_doctor_rerum_naturalium_in_physics
./have_great_colleagues --Erik --Frank --Lisa --Mareen --Maren --Max --Orçun --Tim