Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

minichess package

Overview

Package minichess is an on-chain chess game (standard 8x8 board).

Two ways to play:

  • Solo: NewSoloGame starts a game against the built-in bot. The bot replies inside the same transaction as your move.
  • Two players: Challenge creates a game (open to anyone, or for one invited address); AcceptChallenge takes the empty seat.

Moves use coordinate notation: "e2e4", "g1f3", castling as the king's move ("e1g1"), en passant as the pawn's move to the target square, and promotion as "e7e8" (queen) or "e7e8n" (under-promotion). Visit the realm in gnoweb to see the board and click legal moves.

Function

OfferDraw

func OfferDraw(cur realm, gameID int)
Ask AI Claude ChatGPT

OfferDraw offers a draw in a two-player game. If your opponent has already offered one, this accepts it.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1um2pwwnx3gn8p3ryfdert8mhpu4u4up49sc9ru/minichess" -func "OfferDraw" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1um2pwwnx3gn8p3ryfdert8mhpu4u4up49sc9ru/minichess" -func "OfferDraw" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx