Question: Im currently working on a tetris program I wanted to know if someone could correct the implementation of my saveToFile and retrieveFromFile methods. The saveToFile
Im currently working on a tetris program I wanted to know if someone could correct the implementation of my saveToFile and retrieveFromFile methods. The saveToFile method should allow the user to save a run of the game to a file that they are allowed to name with gam appended to it The retrieveFromFile should allow the user to access and display a previously played game. I wont be showing my full game just what I believe may be neccessary for the fix.
Program:
public class TetrisGame
private TetrisBrick fallingBrick;
private int rows ;
private int cols ;
private int numBrickTypes ;
private Random randomGen;
private int background;
private int state;
private int score;
public TetrisGameint rows, int cols
this.rows rows;
this.cols cols;
initBoard;
this.randomGen new Random;
spawnBrick;
public String toString
String gameFile;
forint row; row
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
