Skip to content
0:00 / 0:00

#haskell#tic-tac-toe#functionalprogramming

[Part 2] Tic-tac-toe Game in Haskell -- Procedural vs Functional

Tsoding

165K subscribers • 25 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Linked in the descriptiontsoding/profun
  • May be out of date. Uploaded 8 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

49K views8 years ago1 recommendation

Programming languagesGame developmentHaskellFunctional programmingGame programming

Tsoding implements a Tic-tac-toe game in Haskell, comparing procedural and functional programming approaches.

Source Code: github.com/tsoding/profun Waste Your Money: patreon.com/tsoding

Why it's here

1 person recommends this

u/reximkutin r/haskell • Recommends

Tic-Tac-Toe Game in Haskell -- Procedural vs Functional Part 2

u/Lolman8D8Din r/functionalprogramming • Mentions

On “If I want a functional version of TicTacToe, where should I store the board's state?”

I'd say that you can model the state as an input to a recursive function. That way, you can run the game loop in a "pure" way except for the user input, which is inherently impure. See this video for a procedural example of tic-tac-toe in C, and then this follow up video for a pure functional version in haskell! Haskell is really good for showing this concept off because of it being a pure functional language.