TASK 1

Game Over!

The aim of 4-in-a-row is to have 4 spaces of the same colour in a row, either horizontal, vertical or diagonal.

However, this has not been implemented, and currently this game will continue until the playing board is full

Each time a player makes a move, the coin drops down to fill the available space.

The position they play in is checked to see if they have won the game

Your task is to implement:

def game_over(col: int, row: int, board: list[list[int]]) -> bool:

Which returns true if either player has won.

col is the column that they have played in. row is the row which they have played in

board: list[list[int]] is the representation of the board. board[0][0] is the top left, board[6][5] is the bottom right.

1 represents red, -1 represents yellow and 0 represents an empty space.

When you have successfully implemented this task, a message will appear.

Good Luck!

Well done!

You have completed all of the tasks.

Return home or take a look at the tutorials

Something isn't quite right...

Close this message and have another go!

GUIDE

This guide is intended to help with syntax. See the prelude section for pre-defined functions and variables. See the tutorials page for tutorials on how to write code.



Can't find what you're looking for?

Check the tutorials page for more!

PRELUDE

The prelude is all the pre-defined functions and variables available to use. See the tutorials page for tutorials on how to write code.



Can't find what you're looking for?

Check the tutorials page for more!