Game apps for smartphones and tablets

Research project PHBern  
HomeStart online editorAndroid TurtlegraphicsPrintJava-Online

TCP FourInARow

Four In A Row (also Connect four) is a two-person strategy game with the aim to bring four of the own tokens in one line (horizontally, vertically or diagonally). That classic board game is played on a vertical, hollow board into which the players in turns drop their tokens. The board consists of seven columns (vertical) and six rows (horizontal). Each player has got 21 same-color tokens. When a player drops a token into a column, he occupies the lowest free space of the column. Winner of the game is the player who first succeeds to bring four of his tokens in one line. The game ends undecided if the board is complete with tokens without any player having been able to build a row with four of his tokens.

This implementation makes it possible that two players logging in with the same Session ID are able to play via the internet. The administration of the session ID is done by our TcpRelay Server that as well arranges that all data is sent and received via Port 80 and therefore not stopped by firewalls.

 

Both players start the game and log in with the same Session ID. In order to test it, start the application twice on the same computer.

Start the game (first connect smartphone or start emulator)

Edit this example in the Online Editor

App installieren auf Smartphone oder Tablet

Download program code: tcpFourInARow.zip

QR-code for the direct download on smartphone