Skip to content

romacll/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workshop/tictactoe

A standard game of Tic-Tac-Toe in Leo.

⭕ ❕ ⭕ ❕ ❌

➖ ➕ ➖ ➕ ➖

⭕ ❕ ⁣❌ ❕ ⭕

➖ ➕ ➖ ➕ ➖

❌ ❕ ❌ ❕ ⭕

Representing State

Leo allows users to define composite data types with the struct keyword. The game board is represented by a struct called Board, which contains three Rows. An alternative representation would be to use an array, however, these are not yet supported in Leo.

Language Features

  • struct declarations
  • conditional statements
  • early termination. Leo allows users to return from a function early using the return keyword.

Running the Program

Leo provides users with a command line interface for compiling and running Leo programs. Users may either specify input values via the command line or provide an input file in inputs/.

Providing inputs via the command line.

  1. Run
leo run <function_name> <input_1> <input_2> ...

See ./run.sh for an example.

Using an input file.

  1. Modify inputs/tictactoe.in with the desired inputs.
  2. Run
leo run <function_name>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages