My nineteenth Kotlin project from JetBrains Academy

Overview

Connect Four

Stage 5 of 5 for JetBrains Academy - Kotlin - Connect Four project.
This stage has us add the option for more than one game ( and keeping score for multiple games ).

Requirements

Description

Before this stage, two players can play only one game. We are going to change this. In this stage, implement the option to play multiple games.

After setting the board dimensions, ask the players if they would like to play a single or multiple games. In the latter case, keep and print the score. When a player wins a game, they get 2 points. If it's a draw, give 1 point to each player.

If the players have chosen the multiple game option, alternate the first move for each new game. However, each player retains the same disc symbol (see Example 3).

Objectives

After setting the board dimensions, players see the following:

Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:

Only positive digits are valid as for input (except 0). If a player inputs anything else, print Invalid input and ask for another try (see Example 4).

If players input 1 or press Enter, start a single game and print the following message:

<1st player's name> VS <2nd player's name>
<Rows> X <Columns>
Single game

In this case, the gameplay remains the same (see Examples 1, 2).

If players input an integer that is bigger than 1, start the multiple game mode and print the following message:

<1st player's name> VS <2nd player's name>
<Rows> X <Columns>
Total <Number of games> games

Print the score after each finished game in the following format:

Score
<1st player's name>: 2 <2nd player's name>: 2

Before the start of a game, print the game number: Game #<Number of game> (see Example 3). Players take turns for the first move, but each player keeps the same disc symbol throughout all games.

At any point of the game, if players input end, your program should output Game over! and terminate the game (see Example 5).

Examples

The greater-than symbol followed by a space (> ) represents the user input. Note that it's not part of the input.

Example 1: a single game (players input 1)

Connect Four
First player's name:
> Lily
Second player's name:
> James
Set the board dimensions (Rows x Columns)
Press Enter for default (6 x 7)
> 5 X 8
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 1
Lily VS James
5 X 8 board
Single game
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 3
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ο║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 3
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║*║ ║ ║ ║ ║ ║
║ ║ ║ο║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 4
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║*║ ║ ║ ║ ║ ║
║ ║ ║ο║ο║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 4
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║*║*║ ║ ║ ║ ║
║ ║ ║ο║ο║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║*║*║ ║ ║ ║ ║
║ ║ ║ο║ο║ο║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 5
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║*║*║*║ ║ ║ ║
║ ║ ║ο║ο║ο║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 6
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║*║*║*║ ║ ║ ║
║ ║ ║ο║ο║ο║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
Player Lily won
Game over!

Example 2: a single game (players input Enter)

Connect Four
First player's name:
> Lily
Second player's name:
> James
Set the board dimensions (Rows x Columns)
Press Enter for default (6 x 7)
> 5x6
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
>
Lily VS James
5 X 6 board
Single game
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║ ║
╚═╩═╩═╩═╩═╩═╝
James's turn:
> 6
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║*║
╚═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║ ║
║ ║ ║ ║ ║ο║*║
╚═╩═╩═╩═╩═╩═╝
James's turn:
> 6
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║*║
║ ║ ║ ║ ║ο║*║
╚═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║ ║
║ ║ ║ ║ ║ο║*║
║ ║ ║ ║ ║ο║*║
╚═╩═╩═╩═╩═╩═╝
James's turn:
> 6
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║*║
║ ║ ║ ║ ║ο║*║
║ ║ ║ ║ ║ο║*║
╚═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6
║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ο║ ║
║ ║ ║ ║ ║ο║*║
║ ║ ║ ║ ║ο║*║
║ ║ ║ ║ ║ο║*║
╚═╩═╩═╩═╩═╩═╝
Player Lily won
Game over!

Example 3: multiple games

Connect Four
First player's name:
> Lily
Second player's name:
> James
Set the board dimensions (Rows x Columns)
Press Enter for default (6 x 7)
> 6x7
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 3
Lily VS James
6 X 7 board
Total 3 games
Game #1
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 1
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ο║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 1
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║ ║ ║ ║ ║ ║ ║
║ο║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 2
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║ ║ ║ ║ ║ ║ ║
║ο║ο║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 2
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║ ║ ║ ║ ║ ║
║ο║ο║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 3
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║ ║ ║ ║ ║ ║
║ο║ο║ο║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 3
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║*║ ║ ║ ║ ║
║ο║ο║ο║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 4
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║*║ ║ ║ ║ ║
║ο║ο║ο║ο║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Player Lily won
Score
Lily: 2 James: 0
Game #2
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 4
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 4
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ ║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 4
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ ║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 4
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║*║ ║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
║ ║ ║ ║*║ο║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Player James won
Score
Lily: 2 James: 2
Game #3
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 7
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ο║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 1
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║ ║ ║ ║ ║ ║ο║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 6
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║ ║ ║ ║ ║ο║ο║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 2
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║ ║ ║ ║ο║ο║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 5
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║ ║ ║ο║ο║ο║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 3
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║*║ ║ο║ο║ο║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 4
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║*║*║*║ο║ο║ο║ο║
╚═╩═╩═╩═╩═╩═╩═╝
Player Lily won
Score
Lily: 4 James: 2
Game over!

Example 4: invalid input

Connect Four
First player's name:
> Lily
Second player's name:
> James
Set the board dimensions (Rows x Columns)
Press Enter for default (6 x 7)
> 5x8
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 0
Invalid input
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> One
Invalid input
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 1 1
Invalid input
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 5
Lily VS James
5 X 8 board
Total 5 games
Game #1
 1 2 3 4 5 6 7 8
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> end
Game over!

Example 5: exit

Connect Four
First player's name:
> Lily
Second player's name:
> James
Set the board dimensions (Rows x Columns)
Press Enter for default (6 x 7)
> 5x7
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 3
Lily VS James
5 X 7 board
Total 3 games
Game #1
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> 1
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ο║ ║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
James's turn:
> 2
 1 2 3 4 5 6 7
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ ║ ║ ║ ║ ║ ║ ║
║ο║*║ ║ ║ ║ ║ ║
╚═╩═╩═╩═╩═╩═╩═╝
Lily's turn:
> end
Game over!

Example 6: plain text board

Connect Four
First player's name: 
> Lily
Second player's name: 
> James
Set the board dimensions (Rows x Columns)
Press Enter for default (6 x 7) 
> 6 X 7
Do you want to play single or multiple games?
For a single game, input 1 or press Enter
Input a number of games:
> 2
Lily VS James
6 X 7 board
Total 2 games
Game #1
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
===============
Lily's turn: 
> 3
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | |o| | | | |
===============
James's turn: 
> 4
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | |o|*| | | |
===============
Lily's turn: 
> 3
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | |o| | | | |
| | |o|*| | | |
===============
James's turn: 
> 5
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | |o| | | | |
| | |o|*|*| | |
===============
Lily's turn: 
> 3
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | |o| | | | |
| | |o| | | | |
| | |o|*|*| | |
===============
James's turn: 
> 6
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | |o| | | | |
| | |o| | | | |
| | |o|*|*|*| |
===============
Lily's turn: 
> 3
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | |o| | | | |
| | |o| | | | |
| | |o| | | | |
| | |o|*|*|*| |
===============
Player Lily won
Score
Lily: 2 James: 0
Game #2
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
===============
James's turn: 
> 1
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*| | | | | | |
===============
Lily's turn: 
> 7
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*| | | | | |o|
===============
James's turn: 
> 2
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*|*| | | | |o|
===============
Lily's turn: 
> 6
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*|*| | | |o|o|
===============
James's turn: 
> 3
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*|*|*| | |o|o|
===============
Lily's turn: 
> 5
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*|*|*| |o|o|o|
===============
James's turn: 
> 4
 1 2 3 4 5 6 7 
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
|*|*|*|*|o|o|o|
===============
Player James won
Score
Lily: 2 James: 2
Game over!
You might also like...
This is a first kotlin project
This is a first kotlin project

SmallPocket This is a first kotlin app, help user to save links easily, and can export to Evernote as weekly. Steps: copy link anywhere open SmallPock

Example of Android project showing integration with Kotlin and Dagger 2

kotlin-dagger-example This project demonstrate how to setup an Android Project with Kotlin and Dagger 2. It's based on Dagger 2 example ##Known issues

Mobile client for official Nextcloud News App written as Kotlin Multiplatform Project
Mobile client for official Nextcloud News App written as Kotlin Multiplatform Project

Newsout Android and iOS mobile client for Nextcloud news App. The Android client is already available to download in the Play Store. F-Droid and Apple

TheMovies 🎬 A demo project for The Movie DB based on Kotlin MVVM architecture and material design & animations.
TheMovies 🎬 A demo project for The Movie DB based on Kotlin MVVM architecture and material design & animations.

A simple project for The Movie DB based on Kotlin MVVM clean architecture and material design & animations. How to build on your environment

This project is basically PowerNukkit but just in Kotlin (check out the original PowerNukkit source here: https://github.com/PowerNukkit/PowerNukkit)
This project is basically PowerNukkit but just in Kotlin (check out the original PowerNukkit source here: https://github.com/PowerNukkit/PowerNukkit)

Introduction Nukkit is nuclear-powered server software for Minecraft: Pocket Edition. It has a few key advantages over other server software: Written

Sample Social Login Project of Spring Boot and Kotlin

Sample-Spring-Boot-Social-Kotlin Sample Social Login Project of Spring Boot and Kotlin dependencies dependencies { implementation("org.springframewor

Starter project to create a simple RESTful web service in Kotlin

Modified: Adding Koin for DI Using JWT for authentication and authorization Dropping proprietary FlyAway tool Single Page Application support Starter

The Okila server project uses the Spring boot framework and uses the Kotlin language

Okila-Server The Okila server project uses the Spring boot framework and uses the Kotlin language Format Response //The response successfully format

Android Kotlin Fundamentals 01.2: Anatomy of Basic Android Project

Welcome to Android Kotlin Fundamentals 01.2: Anatomy of Basic Android Project 👋 Codelab de android para practicar apps Android con Kotlin 🏠 Homepage

Owner
Danny
Danny
Jugando con un Parking realizado como prueba de examen en JetBrains Academy, curso Kotlin Developer

Kotlin Parking Lot Proyecto de evaluación para el título de Kotlin Developer en Jetbrains Academy. Consiste en realizar un parking con las especificac

José Luis González Sánchez 1 Jan 10, 2022
The app i wrote in DEVFEST Çanakkale 2021 - Bugdroid Academy while teaching about kotlin and android.

DiceRollerApp An app that rolls dice when the button is clicked. Made this app in DEVFEST Çanakkale 2021 Bugdroid Academy while teaching about kotlin

Beratcan Güreş 0 Nov 29, 2021
A Tachidesk Desktop UI built in JetBrains Compose

TachideskJUI A free and open source manga reader to read manga from a Tachidesk server. TachideskJUI can run the Tachidesk server on its own, or conne

null 226 Jan 6, 2023
Guide to setup JetBrains Projector and access Android Studio from any device

JetBrains Projector with Android Studio Guide to setup JetBrains Projector and access Android Studio from any device. Blog post Android Studio on an i

Joaquim Verges 326 Dec 15, 2022
>On this day< is a JetBrains Space app which shows Wikipedia-based information about what happened on that or given day

kotlin-spaces-app-onthisday On this day is a JetBrains Space app which shows Wikipedia-based information about what happened on that or given day Stat

Tobias Scholze 2 Oct 20, 2022
sample project that shows you how you can use Ktor to creat a server for real Project.

Ktor-Sample This is a sample project that shows you how you can use Ktor to creat a server for real Project. What is done Save data to database (Get a

Mohamed Emad 4 Dec 23, 2022
Basic-Android-Project - A Basic Android Project with proper structure and all necessary dependencies

Basic-Android-Project A Basic Android Project with proper structure and all nece

Ameer Hamza 2 Mar 18, 2022
A project that helps us generate the test project to test the Gradle plugin.

Ktlint Gradle Provides the function to generate a Gradle project for us to test your Gradle plugin Latest plugin version: [1.0.0] Table of content How

Jack Chen 5 Jul 20, 2022
It is a project that contains lessons and examples about Kotlin programming language. 🇰

Kotlin Tutorials What is Kotlin? I added the platforms it supports and great resources. You can access the article from the link below: https://medium

Halil Özel 94 Dec 22, 2022