Skip to contents

Parse string with game details, see day 2 - 2023

Usage

parse_game(x)

Arguments

x

String with game description.

Value

Data frame with game details.

Examples

parse_game("Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green")
#>   colour count hand_id game_id
#> 1   blue     3       1       1
#> 2    red     4       1       1
#> 3    red     1       2       1
#> 4  green     2       2       1
#> 5   blue     6       2       1
#> 6  green     2       3       1