Skip to main content

01 - Home assignments

Android 01 - Tic-Tac-Toe - View System (views in xml)​

Implement Tic-Tac-Toe.

Requirements:

  • UI done purely in XML, constraintlayout, styles, drawables, include sublayouts as needed

  • achieve as realistic view as possible, game board always square, game board pattern visualised correctly (no black border)

  • rotation support (layout and state)

  • in portrait - top part game stats and control (new game), bottom game board area. in landscape - left stats/control, board right

  • dark/light mode

  • 2 player mode

    • same device handed around between players
  • 1 player mode - human vs ai

    • ai - simple legal random move maker is enough
  • keep track of stats - average game time, wins by X or O, wins/losses ai vs human, etc. display detailed stats on separate activity.

    • use simple persistent data storage - shared preferences
  • visualise winning pieces clearly

  • bonus - implement minimax with alpha-beta pruning for ai player

  • bonus - allow user to set custome non-square board size and winning condition (ala 7x7 board, 4 in row)

  • bonus - allow undo of moves

  • bonus - allow rotation of game board (just game board)

Android 02 - Tic-Tac-Toe - Jetpack Compose​

All the same, but in compose UI.