Post Reply 
1 Utility for Games
03-11-2014, 06:42 PM
Post: #7
RE: 1 Utility for Games
(03-11-2014 03:18 PM)Han Wrote:  
(01-27-2014 07:50 AM)patrice Wrote:  and an RLE coding gives
Code:
"$$$9b4w$7b3wsb2w$7bwb2c2bw$7bw2bc2bw$7bw5bw$7b3w2b2w$9bw3bw$9bw3dw$9b5w$$$!"

The hard part is to replace the matrices in source code by the strings and decode them on fly as needed.

Even shorter is to code multiple $'s in the form n$. For example, $$$ should be coded as 3$. It shouldn't be all that hard to create a small program to convert from matrix over to a string -- it's easier to edit a matrix than it is to create a string and keep all the codes correct.
You perfectly right, if you look at the decoder, you will see that it handle the case already.
I didn't handled it in the coder for 3 reason:
  • 3 or more empty lines in a row is not very common over the 40 levels.
  • it complicate the encoder for only a very little gain.
  • I like to see all the $ , it help me do manual checking of the coding.

If you like it, feel free to tweak the various levels, it saves a bout 30 chars across the 40 levels.
When I first put it in Sokoban, I didn't removed the drawscreen() comand which have a side effect, it removes the pusher from the level matrix. So I have done some manual testing before I understood where was the problem.

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
1 Utility for Games - patrice - 01-25-2014, 06:46 PM
RE: 1 Utility for Games - patrice - 01-27-2014, 07:50 AM
RE: 1 Utility for Games - Han - 03-11-2014, 03:18 PM
RE: 1 Utility for Games - patrice - 03-11-2014 06:42 PM
RE: 1 Utility for Games - Han - 03-11-2014, 07:43 PM
RE: 1 Utility for Games - ArielPalazzesi - 01-27-2014, 11:25 PM
RE: 1 Utility for Games - patrice - 03-11-2014, 01:04 PM
RE: 1 Utility for Games - patrice - 03-11-2014, 08:42 PM



User(s) browsing this thread: 1 Guest(s)