练习2D Array的使用方法,实现任意关于2D Array的应用。
Requirement
This is a free choice program to demonstrate a 2D array. Please don’t choose the totally obvious choices such as tic tac toe where you can obtain the code directly from online. If you were going to do tic tac toe you would have to modify the game or make it totally unique from code that is online. Preferably, I would like you to make something zany up instead, it doesn’t have to be overly difficult, it can actually be pretty basic (but not ridiculously basic).
For example, The 2D array could represent a minefield and you might have a game to pick (row,col) locations to win a prize without picking one that has a mine bomb in it, or, you could have a certain number guesses to find a hidden treasure, or advance to next round, or guess the right answer or etc. You could try to solve a mental puzzle. You could be a game piece moving around on the board. You could do something requiring someone to pick out matching items in the array to win, etc. You could have two 2D arrays and do some sort of matching game. You could look to see if things are in the array. You could have the player jump to random positions (or pick them) and see how long he can stay alive before landing on a spot that kills him. Get creative. Please be sure that you print the array out during the game as it updates. You can have a very simple text interface to your game. Get creative. You can store ints, doubles, strings, or even objects in the array whatever you want.
The idea is to be able to define and use a 2D array, remember, this assignment is meant to be on the easier side therefore don’t tie yourself in knots doing anything overly complicated. The grading criteria is just that I want to be able to look at your program and output and be convinced you understand how to print an array using a nested for loop and I want to be sure that you could write code that searches for things in the array or does some relevant basic logic to determine a winner etc.
Please remember to explain at the top exactly what your game/demo is doing, and to provide both source code and output of it in your PDF. Once you’ve watched the videos on arrays and 2D arrays this task should only take you a couple hours depending on how cool you make it. (if you want to use a 3d array that’s fine too)