Skip to content

Commit

Permalink
Address more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Feb 17, 2025
1 parent b0d6d1f commit bc223c7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 21 deletions.
4 changes: 2 additions & 2 deletions documentation/language/04_operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ let b: i8 = a.div_wrapped(-1i8); // -128i8

#### Description

Divides `first` by `second`, wrapping around at the boundary of the type, and storing the result in `destination`.
Divides `first` by `second`, wrapping around at the boundary of the type, and storing the result in `destination`. Halts if `second` is zero.

#### Supported Types

Expand Down Expand Up @@ -989,7 +989,7 @@ let b: i8 = a.rem_wrapped(-1i8); // 0i8
```

#### Description
Computes the truncated remainder of `first` divided by `second`, wrapping around at the boundary of the type, and storing the result in destination.
Computes the truncated remainder of `first` divided by `second`, wrapping around at the boundary of the type, and storing the result in destination. Halts on division by zero.

#### Supported Types

Expand Down
2 changes: 2 additions & 0 deletions documentation/leo_by_example/01_auction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: auction
title: A Private Auction using Leo
---

**[Source Code](https://github.com/ProvableHQ/leo-examples/tree/main/auction)**

## Summary

A first-price sealed-bid auction (or blind auction) is a type of auction in which each participant submits a bid without knowing the bids of the other participants.
Expand Down
2 changes: 2 additions & 0 deletions documentation/leo_by_example/02_basic_bank.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: basic_bank
title: A Basic Bank using Leo
---

**[Source Code](https://github.com/ProvableHQ/leo-examples/tree/main/basic_bank)**

## Summary

This program implements a bank that issues tokens to users and allows users to deposit tokens to accrue simple interest on their deposits.
Expand Down
2 changes: 2 additions & 0 deletions documentation/leo_by_example/03_vote.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: vote
title: A Voting Program using Leo
---

**[Source Code](https://github.com/ProvableHQ/leo-examples/tree/main/vote)**

## Summary

`vote.leo` is a general vote program.
Expand Down
2 changes: 2 additions & 0 deletions documentation/leo_by_example/04_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: token
title: A Custom Token in Leo
---

**[Source Code](https://github.com/ProvableHQ/leo-examples/tree/main/token)**

## Summary

A transparent & shielded custom token in Leo.
Expand Down
2 changes: 2 additions & 0 deletions documentation/leo_by_example/05_tictactoe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: tictactoe
title: A Game of Tic-Tac-Toe in Leo
---

**[Source Code](https://github.com/ProvableHQ/leo-examples/tree/main/tictactoe)**

## Summary

We can play a standard game of Tic-Tac-Toe in Leo. I think we all know what a tictactoe board looks like:
Expand Down
46 changes: 27 additions & 19 deletions documentation/leo_by_example/06_battleship.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,37 @@ id: battleship
title: A Game of Battleship in Leo
---

**[Source Code](https://github.com/ProvableHQ/leo-examples/tree/main/battleship)**

## Contents

- [Contents](#contents)
- [Summary](#summary)
- [Build](#how-to-build)
- [Run](#how-to-run)
- [1. Initializing the Players](#1-initializing-the-players)
- [2: Player 1 Places Ships On The Board](#2-player-1-places-ships-on-the-board)
- [3: Player 1 Passes The Board To Player 2](#3-player-1-passes-the-board-to-player-2)
- [4: Player 2 Places Ships On The Board](#4-player-2-places-ships-on-the-board)
- [5: Passing The Board Back To Player 1](#5-passing-the-board-back-to-player-1)
- [6: Player 1 Takes The 1st Turn](#6-player-1-takes-the-1st-turn)
- [7: Player 2 Takes The 2nd Turn](#7-player-2-takes-the-2nd-turn)
- [8: Player 1 Takes The 3rd Turn](#8-player-1-takes-the-3rd-turn)
- [9: Player 2 Takes The 4th Turn](#9-player-2-takes-the-4th-turn)
- [10. Who Wins?](#10-who-wins)
- [How to Run](#how-to-run)
- [1. Initializing the Players](#1-initializing-the-players)
- [2. Player 1 Places Ships on the Board](#2-player-1-places-ships-on-the-board)
- [3: Player 1 Passes The Board To Player 2](#3-player-1-passes-the-board-to-player-2)
- [4: Player 2 Places Ships On The Board](#4-player-2-places-ships-on-the-board)
- [5: Passing The Board Back To Player 1](#5-passing-the-board-back-to-player-1)
- [6: Player 1 Takes The 1st Turn](#6-player-1-takes-the-1st-turn)
- [7: Player 2 Takes The 2nd Turn](#7-player-2-takes-the-2nd-turn)
- [8: Player 1 Takes The 3rd Turn](#8-player-1-takes-the-3rd-turn)
- [9: Player 2 Takes The 4th Turn](#9-player-2-takes-the-4th-turn)
- [10. Who Wins?](#10-who-wins)
- [ZK Battleship Privacy](#zk-battleship-privacy)
- [Modeling the Boards and Ships](#modeling-the-board-and-ships)
- [Validating a Single Ship](#validating-a-single-ship-at-a-time)
- [Validating all Ships](#validating-all-ships-together-in-a-single-board)
- [Sequencing Game State](#ensure-that-players-and-boards-cannot-swap-mid-game)
- [Preventing Double Moves](#ensure-that-each-player-can-only-move-once-before-the-next-player-can-move)
- [Ensuring Valid Moves](#enforce-constraints-on-valid-moves-and-force-the-player-to-give-their-opponent-information-about-their-opponents-previous-move-in-order-to-continue-playing)
- [Winning](#winning-the-game)
- [Modeling the board and ships](#modeling-the-board-and-ships)
- [Examples of valid board configurations:](#examples-of-valid-board-configurations)
- [Examples of invalid board configurations:](#examples-of-invalid-board-configurations)
- [Validating a single ship at a time](#validating-a-single-ship-at-a-time)
- [Bit Counting](#bit-counting)
- [Adjacency Check](#adjacency-check)
- [Splitting a row or column](#splitting-a-row-or-column)
- [Ensuring a bitstring is a power of 2](#ensuring-a-bitstring-is-a-power-of-2)
- [Validating all ships together in a single board](#validating-all-ships-together-in-a-single-board)
- [Ensure that players and boards cannot swap mid-game](#ensure-that-players-and-boards-cannot-swap-mid-game)
- [Ensure that each player can only move once before the next player can move](#ensure-that-each-player-can-only-move-once-before-the-next-player-can-move)
- [Enforce constraints on valid moves, and force the player to give their opponent information about their opponent's previous move in order to continue playing](#enforce-constraints-on-valid-moves-and-force-the-player-to-give-their-opponent-information-about-their-opponents-previous-move-in-order-to-continue-playing)
- [Winning the game](#winning-the-game)

## Summary

Expand Down

0 comments on commit bc223c7

Please sign in to comment.