Skip to content

Chahnapatel09/Tetris-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฉ Tetris Solver

Welcome to my Tetris Solver! ๐ŸŽฎโœจ

This project is a Java-based puzzle solver that intelligently places Tetris pieces on a grid to maximize your score while minimizing penalties. Think of it as a tiny AI brain ๐Ÿง  for Tetris โ€” it plans ahead, thinks strategically, and clears rows like a champ! ๐Ÿ†

๐ŸŒŸ Features

  • ๐ŸŽฏ Strategic Solver: Uses smart placement and lookahead to optimize moves.
  • โšก Efficient & Fast: Precomputed rotations, fast board checks, and clever data structures make it lightning quick.
  • ๐Ÿง  Heuristic Guidance: Prioritizes row clearing and low-gap placements for maximum points.
  • ๐Ÿ—๏ธ Flexible Test Cases: Handles different board setups, multiple pieces, and variable lookahead depths.
  • ๐Ÿ“Š Scoring System: Accurate points for cleared rows and penalties for leftover pieces.

๐Ÿง  Working

  • Initial empty board ๐ŸŸฆ



    --#-- -###-

  • Piece placement examples with Lookahead planning in action ๐Ÿ”ฎ Adding a (## \n ##\n) Z shaped tetris piece:


    -#--- ###-- ####-

    Adding a ( ##\n## \n) S shaped tetris piece:


    -#-#-

  • Row clearing celebration ๐ŸŽ‰




    -#-#-

Score: 200 Hurray !! 2 rows cleared.

๐Ÿ”ฎ Future Scope

  • Optimize for deeper lookahead with faster algorithms โšก
  • Automatic heuristic tuning using ML or genetic algorithms ๐Ÿค–
  • Adaptive planning based on board complexity ๐ŸŒ

๐Ÿš€ Try It Yourself

Clone, compile, and watch the solver in action โ€” see how it masterfully places tetrominoes and maximizes your score! ๐ŸŽฎ๐Ÿ”ฅ

Have fun exploring, and may your rows always clear! โœจ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages