How to manage memory effictively in corona sdk

Hello there,

I am creating a solitaire game using Corona and for that i want to store the game on each step so a player can undo from here to any step.

Right now what i am doing is i am making a json file and adding data in it.

Let me tell what i am storing,
1: 4 arrays from foundation.

2: 7 Arrays from Tableau.

3: Waste cards array

4: Top array cards open

where 1 and 2 are further have 2 arrays for each cars like is card open or closed and its value.

Now issue is when i am storing this in json the file size is increasing almost 5 kb- 7 kb on each step

Now if a player have moved 70 steps then 350-400KB size got increased which makes game slow a bit

Please suggests me a better way so i can store game state on each step.

Thanks in Advance,

Sahil

Normally, you store only the moves (and not the entire state).  You can then roll back or forward by navigating the table of changes.

Normally, you store only the moves (and not the entire state).  You can then roll back or forward by navigating the table of changes.