Question: Could someone please fix my toString, saveToFile, and retrieveFile method so that they properly work. The saveToFile method should allow the user to save a

Could someone please fix my toString, saveToFile, and retrieveFile method so that they properly work. The saveToFile method should allow the user to save a game to the file directory with a name of their choice. Currently it only allows the user to access the file directlory and create a folder to store the game in but it does not save. The retrieveFromFile method does not work at all.This is not all the code but some of it.
public class TetrisGame
{
private TetrisBrick fallingBrick;
private int rows =2;
private int cols =2;
private int numBrickTypes =7;
private Random randomGen;
private int[][] background;
private int state;
private int score;
public String toString()
{
String gameFile="";
for(int row=0; row
Could someone please fix my toString, saveToFile,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!