Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

My Aleo contribution

NotificationsYou must be signed in to change notification settings

Mazzarothleo/mazzaroth.aleo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

⭕ ❕ ⭕ ❕ ❌

➖ ➕ ➖ ➕ ➖

⭕ ❕ ⁣❌ ❕ ⭕

➖ ➕ ➖ ➕ ➖

❌ ❕ ❌ ❕ ⭕

Leo allows users to define composite data types with thestruct keyword.The game board is represented by a struct calledBoard, which contains threeRows.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 thereturn 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 ininputs/.

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. Modifyinputs/tictactoe.in with the desired inputs.
  2. Run
leo run<function_name>

Executing the Program

leo execute<function_name><input_1><input_2> ...

Playing the Game

1. Create a new game board

leo run new
000
000
000

2. Player 1 makes a move

leo run make_move 1u8 1u8 1u8"{ r1: { c1: 0u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }"
100
000
000

3. Player 2 makes a move

leo run make_move 2u8 2u8 2u8"{ r1: { c1: 1u8, c2: 0u8, c3: 0u8 }, r2: { c1: 0u8, c2: 0u8, c3: 0u8 }, r3: { c1: 0u8, c2: 0u8, c3: 0u8 } }"
100
020
000

About

My Aleo contribution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp