1 Utility for Games
|
03-11-2014, 07:43 PM
Post: #8
|
|||
|
|||
RE: 1 Utility for Games
(03-11-2014 06:42 PM)patrice Wrote:(03-11-2014 03:18 PM)Han Wrote: 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. Yeah, I guess that would be a much smaller gain if there are not many blank rows. I was basing this idea off of how I encode bitmaps as sub-bitmaps for this game. There are certain bitmaps that are used very frequently (i.e. a "default" bitmap). In your particular example, the b and w's appear most frequently. One of those (say b) can be considered the default. So rather than encoding as: "3b4w" you save a few more characters by using "34w" -- with the understanding that a digit without an alpha code refers to repeated blanks. If the digits need to be larger than 0-9, then you can just use A through Z in upper case (gives you up to 26 repeats). Or use any consecutive block of characters for the count, and a separate block of characters for the type. Thus you would have either: <ascii char for count> [<ascii char for type>] (the second value being optional). The count char should come from A through Z (for example) and the type perhaps from a through z (all lower case). Without doing any hard analysis, a quick glance suggests that most of the code is a digit followed by b or a digit followed by w. So roughly speaking ~20% might be saved? Since it is done during initialization, you would hardly notice the extra bit of code/time needed to handle the differentiation between <count><code> vs. just <count> by itself (for the default "blank" code). Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
1 Utility for Games - patrice - 01-25-2014, 06:46 PM
RE: 1 Utility for Games - cyrille de brébisson - 01-27-2014, 06:41 AM
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)