Skip to content

jbauer12/fpropython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comparing functional programming in Go with Python

Using the Minimax algorithm with the Checkers board game as an example

Purpose

The purpose of this repository is to show how functional concepts can be implemented in the two languages Python and Go. Therefore, the same use case is implemented in both languages. The essay (which is also in this repository) aims firstly to introduce the basic concepts of functional programming. Second, how it can be implemented in Go or Python. Third, to compare these implementation techniques with each other.

Checkers Board Game

  • a game for two players, one with red pieces, the other with green pieces

  • The green player (you) moves first, then the players take turns.

Starting a game

Rules

  • A move consists of moving a piece diagonally to an adjacent unoccupied square.

Starting a game

  • If there is an opponent's piece in the adjacent square and the square immediately behind it is vacant, the piece must be captured and removed from the game by jumping over it. After the smashing, the same player has the turn.

Starting a game

  • If a player either has no pieces left or cannot move due to being blocked, he loses the game.

Starting a game

  • If a player get to the opposite base line then he gets a Checker (Dame).

Starting a game

  • A Checker can go in every direction, whereas a normal piece can only go in one direction

Starting a game

How to use this code

In the subdirectories (Python and Go) there is another README file that explains how to run the code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published