summaryrefslogtreecommitdiff
path: root/src/main/scala/me/robbyzambito/othello/Main.scala
blob: 6ee01038183faf9c240aac7ce37f95f3e08a0646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package me.robbyzambito.othello

import me.robbyzambito.othello.game.Game

import scala.annotation.tailrec

object Main extends App {

  val game = Game()

  @tailrec
  def gameLoop(game: Game): Unit = {
    if (game.winner.isEmpty) {
      gameLoop(game.takeTurn)
    } else {
      println(game.winnerMessage)
    }
  }

  gameLoop(game)

}