1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-15 01:52:11 +03:00
juvix/examples/milestone/TicTacToe
Łukasz Czajka 60a191b786
Numeric, ordering and equality traits (#2433)
* Adapts to https://github.com/anoma/juvix-stdlib/pull/86
* Adds a pass in `toEvalTransformations` to automatically inline all
record projection functions, regardless of the optimization level. This
is necessary to ensure that arithmetic operations and comparisons on
`Nat` or `Int` are always represented directly with the corresponding
built-in Core functions. This is generally highly desirable and required
for the Geb target.
* Adds the `inline: always` pragma which indicates that a function
should always be inlined during the mandatory inlining phase, regardless
of optimization level.
2023-10-09 18:25:01 +02:00
..
CLI Numeric, ordering and equality traits (#2433) 2023-10-09 18:25:01 +02:00
Logic Numeric, ordering and equality traits (#2433) 2023-10-09 18:25:01 +02:00
juvix.yaml Add main field to juvix.yaml (#2120) 2023-05-24 15:42:20 +02:00
README.org Remove missing Juvix examples and webapp example from docs build (#1890) 2023-03-15 12:01:06 +00:00
TicTacToe.juvix CI pre-commit maintenance (#1905) 2023-03-23 08:57:38 +00:00

TicTacToe

TicTacToe

This directory contains Juvix code for a Tic-Tac-Toe game that can be run as a terminal application.

The common logic code is in Logic/, the code specific to the terminal application is in CLI/.

Terminal application

To compile and run the terminal application use the following steps:

cd CLI
juvix compile TicTacToe.juvix
./TicTacToe

You will see the following output:

MiniTicTacToe
-------------

Type a number then ENTER to make a move

+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
| 4 | 5 | 6 |
+---+---+---+
| 7 | 8 | 9 |
+---+---+---+
Player X: