How to use the command 'bastet' (with examples)
Bastet is a command-line game that serves as a clone of the popular game Tetris. It allows users to play the game directly in the terminal. This article will guide you through various use cases of the ‘bastet’ command.
Start a Tetris game:
Code:
bastet
Motivation: Starting a Tetris game is the first step to enjoy playing this classic game in the terminal. It allows you to test your skills and have some fun in your spare time.
Explanation: By simply entering the ‘bastet’ command in the terminal, you initialize the game and a Tetris board will appear on your screen.
Example output:
Score: 0
Level: 1
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
----------- ▌
Next: Z
Navigate the piece horizontally:
Code:
Left arrow key or Right arrow key
Motivation: To reposition the falling Tetrimino piece horizontally, it is necessary to utilize the left or right arrow key. This allows for strategic placement to create and clear rows.
Explanation: Once the Tetris game is started, the falling piece moves horizontally using the left and right arrow keys. The left arrow key shifts the piece one column to the left, while the right arrow key moves the piece one column to the right.
Example output:
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
-------------XX--- ▌
-------------X---- ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
Next: O
Rotate the piece clockwise or counterclockwise:
Code:
Spacebar or Up arrow key
Motivation: Rotating a Tetrimino piece can help you find the perfect spot to fit it into a desired gap, allowing for a faster clearing of rows and an increased score.
Explanation: During gameplay, you can rotate the falling Tetrimino piece clockwise or counterclockwise by pressing either the spacebar or the up arrow key.
Example output:
------------------ ▌
--X--------------- ▌
XXX--------------- ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
Next: I
Soft drop the piece:
Code:
Down arrow key
Motivation: By utilizing the soft drop feature, you can accelerate the descent of the falling Tetrimino piece to clear rows faster and achieve a higher score.
Explanation: To make the Tetrimino piece fall faster, you can press the down arrow key. This is known as a soft drop, as it doesn’t instantly lock the piece into place.
Example output:
------------------ ▌
XX---------------- ▌
XX---------------- ▌
XXX--------------- ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
Next: J
Hard drop the piece:
Code:
Enter
Motivation: Hard dropping allows you to instantly place the Tetrimino piece at its lowest position, saving time and allowing you to focus on strategy and clearing rows efficiently.
Explanation: To instantly lock the falling Tetrimino piece at its lowest possible position, press the enter key. This is known as a hard drop and is particularly useful for quickly getting the piece to its final position.
Example output:
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
---X-------------- ▌
--XXX------------- ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
------------------ ▌
Next: Z
Pause the game:
Code:
p
Motivation: Pausing the game allows you to take a break or attend to other activities without losing your progress or prematurely ending the game.
Explanation: To temporarily pause the game, press the ‘p’ key. This will freeze the current state of the game until you choose to resume playing.
Example output:
GAME PAUSED
Quit the game:
Code:
Ctrl + C
Motivation: Quitting the game is useful when you want to exit the terminal and stop playing the game.
Explanation: To quit the game, press and hold the ‘Ctrl’ key, then press the ‘C’ key. This will immediately terminate the game and return you to the terminal prompt.
Example output: (None, as the game is terminated)
Conclusion:
The ‘bastet’ command provides a convenient way to play Tetris directly in your terminal. With the ability to start the game, navigate the pieces, rotate them, and use drop functions, it provides all the necessary functionality to enjoy this classic game. Whether you want to take a break or quit, the ‘bastet’ command allows you to do so easily. So, launch the ‘bastet’ command, hone your Tetris skills, and enjoy the endless fun!