# Turn-based games in typed Racket

**URL:** <https://racket.discourse.group/t/turn-based-games-in-typed-racket/2876>\
**Category:** Questions & Answers\
**Created:** [April 22, 2024, 3:46pm UTC](https://racket.discourse.group/t/turn-based-games-in-typed-racket/2876 "2024-04-22T15:46:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendrikboom3](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/hendrikboom3/32/2748_2.png) [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Post date:** [April 22, 2024, 3:46pm UTC](https://racket.discourse.group/t/turn-based-games-in-typed-racket/2876/1 "2024-04-22T15:46:15Z")

</div>

How can one do something like [Turn-Based Games] [Turn-Based Games](https://docs.racket-lang.org/turn-based-game/index.html) in Typed Racket?  
The trouble is that each game one might implement requires its own types for [Side](https://docs.racket-lang.org/turn-based-game/index.html#%28tech._side%29), [GameState](https://docs.racket-lang.org/turn-based-game/index.html#%28tech._gamestate%29), and [MoveChoice](https://docs.racket-lang.org/turn-based-game/index.html#%28tech._movechoice%29).  
This presumably affects the types of all the methods in the package turn-based-games.  
Turn-based-games gets away with this by being written in untyped Racket. Is there anything that would enable one to write games, or even turn-based games, in typed Racket?

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [April 23, 2024, 4:02pm UTC](https://racket.discourse.group/t/turn-based-games-in-typed-racket/2876/2 "2024-04-23T16:02:43Z")

</div>

I may be misunderstanding you here, but it sounds like this problem is solved by parameterized types. That is, if I want a type to depend on three other types that are specified separately, I can write `(All (T U V) ... whatever my type is ...)` and my type can freely use T, U, and V. When a value of this type is used, any types can be used in place of T, U, and V.
