Effacer les filtres
Effacer les filtres

Minesweeper help with resetting the display screen

2 vues (au cours des 30 derniers jours)
Nathen Eberhardt
Nathen Eberhardt le 28 Fév 2020
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?

Réponses (1)

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

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by