From 985ae50934bd216896c3e99bc29ff5e49197fa3f Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Sun, 24 May 2026 19:03:23 +0200 Subject: [PATCH] use int in game logic --- src/game.odin | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game.odin b/src/game.odin index 8252a98..f841ccb 100644 --- a/src/game.odin +++ b/src/game.odin @@ -13,20 +13,20 @@ COLORS :: enum { } Card :: struct { - value: u8, + value: int, color: COLORS, } -VALUES: []u8 : {1, 1, 1, 2, 2, 3, 3, 4, 4, 5} +VALUES: []int : {1, 1, 1, 2, 2, 3, 3, 4, 4, 5} Player :: struct { hand: [dynamic]Card, } Game :: struct { - num_players: u8, - hint_tokens: u8, - lives_left: u8, + num_players: int, + hint_tokens: int, + lives_left: int, players: [dynamic]Player, deck: [dynamic]Card, } @@ -52,7 +52,7 @@ create_player :: proc(s: ^Game) -> (p: Player) { return } -create_game :: proc(hint_tokens, lives_left, num_players: u8) -> (s: Game) { +create_game :: proc(hint_tokens, lives_left, num_players: int) -> (s: Game) { assert(num_players > 1 && num_players < 6) s.hint_tokens = hint_tokens s.lives_left = lives_left