ConnectN

The ConnectN Service provides helpers for building games like Connect-4 and Tic-Tac-Toe.

RPCS

ConnectN.isFullBoard()

Check if every position on the current board is occupied.

Returns: Boolean (Boolean) - true if the board is full, otherwise false

ConnectN.isGameOver()

Check if the current game is over.

Returns: Boolean (Boolean) - true if game over, otherwise false

ConnectN.newGame(row: Number?, column: Number?, numDotsToConnect: Number?)

Create a new ConnectN game

Arguments:

  • row: Number? (Number) - The number of rows on the game board

  • column: Number? (Number) - The number of columns on the game board

  • numDotsToConnect: Number? (Number) - The number of connected tiles required to win

ConnectN.play(row: Integer, column: Integer)

Play at the given row, column to occupy the location.

Arguments:

  • row: Integer (Integer) - The given row at which to move

  • column: Integer (Integer) - The given column at which to move