![]() ![]() # variables below will be used to randomly get the extract-able cells/fields from our mine.į="1 2 3 35 30 20 22 10 0 -10 -20 -25 -30 -35 -3 -2 -1" ![]() Score=0 # will be used to store the score of the game The variables below are some default variables, declared to call randomly for field placement, like the variables a-g, we will use them to calculate our extractable mines: # variables (I wrote this for fun, but I would happily welcome your contributions to make it look better.) By limiting the number of locations, it will be easy to build on top of this. The logic could be better, but I wanted to keep the game looking simple and a bit immature. These are the locations that mines could be placed on the board. The player's objective is to reveal cells that contain no mine, and to never reveal a mine. Bash version of the game uses a 10x10 matrix, implemented using simple bash arrays.įirst, I assign some random variables. ![]() Each cell may or may not contain an explosive mine. In Minesweeper, the game world is a 2D array (columns and rows) of concealed cells.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |