class PLAYER -- a player in the Snakes and Ladders game creation make feature id: INTEGER -- player's id position: INTEGER -- player's position on game board make (ident: INTEGER) is -- Create a player with id = ident and position = 0 local do id := ident position := 0 end -- make update_position (by_amount: INTEGER) is -- Change position of player by by_amount; by_amount may be negative local do position := position + by_amount end -- update_position print_player_info is -- Display id and position of player local do io.put_string("Player ") io.put_integer(id) io.put_string(" at ") io.put_integer(position) end -- print_player_info end -- class PLAYER