Azzera filtri
Azzera filtri

Minesweeper help with resetting the display screen

2 visualizzazioni (ultimi 30 giorni)
How do I create code that will reset the screen back to the original code? Basically I am playing minesweeper and the player (my_position) is set on the top right of the matrix as 100. I need to reset my matrix back to -1s and the 100 at the top.. when my_position steps on a mine (or a 1 in the 'mines' matrix). mines = rand(10) > .85
I had to create a 10x10 matrix of -1s (game_window(1:10,1:10) = -1) . So when my_position on the mines field in correlation to the game_window steps on a (1) in mines I need to reset the screen to 10x10 of -1s and 100 at the top.
Any help?

Risposte (1)

Walter Roberson
Walter Roberson il 28 Feb 2020
clf() or cla()
Anything beyond that would require knowledge of how you are drawing onto the screen at present.

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by