play: Play a single move in the game

Description Usage Arguments Value See Also Examples

View source: R/play.R

Description

Pushing one hand of a player against the hand of another player implies that the number of fingers in the target hands becomes the sum of the original fingers' number and the hitting fingers' number, modulus the number of fingers in the hands.

Usage

1
play(game, active_player, active_hand, target_player, target_hand)

Arguments

game

An alicetwist game object.

active_player

The ID of the striker player.

active_hand

The ID of the hand with which the active_player hits the opponent's hand.

target_player

The ID of the player who undergoes the hit.

target_hand

The ID of the hand which is been hit.

Value

A new alicetwist game object after the given move is accomplished.

See Also

new_game

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Create a basic game and then make a move

game <- new_game()
game

# Make a move
game_after_move <- play(game, 1, 1, 2, 1)
game_after_move

# Make a move for both the players
game_after_move <- game %>% play(1, 1, 2, 1) %>% play(2, 1, 1, 1)
game_after_move

msaltieri/alicetwist documentation built on May 23, 2019, 7:50 a.m.