5x5 or 7x7 Grid game using c# winforms

Sdílet
Vložit
  • čas přidán 22. 11. 2023
  • Hi
    in this video i will show you how i made game using c#
    For Source Code:
    www.fiverr.com/sst_developer
    muhammadsiddique5506@gmail.com
    About "the game":
    1. The game is played by a single user only. The program (i.e., computer) itself does not play it against the player but "watches" and monitors a game.
    2. Each game contains three levels: 1, 2, and 3.
    3. A new game always begins from level 1. Completing level 1 automatically moves the game to level 2, then level 3.
    4. When requested by the player, a game can be paused at any moment of any level and saved. Once a game is saved, the program execution automatically stops until user runs the program again. In this case, because it's not a new game, it does not begin from level 1, instead, the saved game should be resumed and displayed automatically.
    5. Level 1 of the game:
    o The program should show the player a 5x5 grid with number 1 randomly placed in a cell, here "randomly" means each time a game begins from level 1, the first number, 1, is placed by the program at a randomly selected cell of the 5x5 grid. Hint: every programming language supports a random function or method.
    o To complete and end this level of a game, the player needs to enter 24 numbers from 2 to 25, one a time, in ascending order into an empty cell of the 5x5 grid without violating the following location rule:
     The empty cell must be an adjecent cell of the predecessor of the number to be entered.
    *An adjacent cell 'X' of cell 'Y' is any cell that is only one step away from 'Y', which could be a cell on E, W, S, N, NE, NW, SE, or SW of 'Y', as long as it is located within the border of the 5x5 grid
    o The program must "signal" the player (e.g., displaying a message, a dialog, a beep, etc.) and reject the action if any of the following occurs when a number is entering into a cell of the 5x5 grid:
     An invalid number, including duplicates, wrong type, not the successor of last entered number.
     An invalid location, including an out of grid cell, a non-empty cell, a cell that is not an adjacent cell of the predecessor number (ie., a cell that is two or more steps away from the predecessor number.)
    o The program should allow the player to rollback (i.e., erase or undo) one or more numbers starting from the most recently entered cell. This is necessary because the player may find no adjacent cells (i.e.
    o , a dead end) to place a number and must re-do at least its predecessor number or more by resetting them first.
    o Note that even the initial number, 1, is placed in the same cell, level 1 of the game may result differently, depending on where each number of 2 ~ 25 is entered.
    6. Level 2 of the game:
    o When level 1 is completed, the game displays automatically a ring of 24 additional empty cells surrounding the 5x5 grid with numbers filled up in level 1. See the blue and yellow cells in the figures shown below--the color is for illustration only.
    o To complete and end this level of a game, the player needs to enter again 24 numbers from 2 to 25, one a time without duplicates, in ascending order into an empty ring cell surrounding the 5x5 grid. The cell to enter a number must be one of the following:
     It is one of empty ring cells located at either top or bottom of the column where the number is seen in the 5x5 grid.
     It is one of empty ring cells located at either left or right of the row where the number is seen in the 5x5 grid.
     If the number to be entered is sitting along one of the two diagonals in the 5x5 grid, the cell to enter the number can be either one of the two ending cells of the diagonal (the yellow cells shown in the above figures), if it is empty.
    o Like in level 1, the program must "signal" the player and reject the action for an invalid number to enter or the cell selected fails all the above location rules.
    o Same as in level 1, the player is allowed to rollback (i.e., erase or undo) one or more numbers when requested.
    o Note that, for a given 5x5 grid filled up with 25 numbers, level 2 can still complete and end with a different ring of 24 numbers.
    7. Level 3 of the game:

    o When level 2 is completed, the game automatically moves on to level 3 by hiding all numbers except 1 from the 5x5 grid. See the left figure below.

    o To complete and end this final level of a game, the player needs to enter one more time all 24 numbers, 2 ~ 25, one a time without duplicates, in ascending order to fill up the 5x5 center grid.
     The number to enter must be seen at either end of the row or column of the adjacent cell.
     If an adjacent cell happens to be located on one of the two diagonals of the 5x5 grid, then the number to enter must be seen at either end of the diagonal.
    o Entering an invalid number or the selected cell fails any of the above placing rules should be "signaled" and rejected as in previous levels.
    o Same as in level 1 and 2, the player is allowed to rollback (i.e., erase or undo) one or more numbers when requested.
  • Věda a technologie

Komentáře •