Skip to content

twixl0ver/TetrisBot

Repository files navigation

TetrisBot

Bot that plays tetris.

  • OMP for paralleling
  • CMake as build system
  • osmanip as external library

UML Diagram

Performance Test

1 thread 2 threads 4 threads
1thr_no 2thr_no 4thr_no
~120ms ~66ms ~53ms
1.8 times faster 2.2 times faster

Install and Use

  • Install osmanip as written here

  • Download our latest release

  • In the downloaded folder:

    $ mkdir build
    $ cd build
    $ cmake ..
    
  • Compile project:

    $ make
    
  • And run it:

    $ ./TetrisBot
    

    If you want to change the number of threads (by default all threads are used), you should run the project like this:

    $ OMP_NUM_THREADS=x ./TetrisBot
    

    where x is preferred number of threads.

    Note: If you want to change the time between frames, you have to go in settings.h, change the value of FrameTime to whatever you want, and then compile project again. In the same way, you can change the number of pieces known to the bot (value of KnownPiecesCount), but keep in mind that the calculation time will grow exponentially.

About

Bot that plays tetris

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •