Hi Zamoht,
Yes, Level 6 is possible. One hint: The leaf on the right side must be the last one you put a mushroom on. At the very end you might need to push that last mushroom down first, and then up again...
@royalfool, Thanks. But I have a question: How do you store all the scores? I am assuming that you are concatenating them as a three digit number set to a string, with a seperator. Am I right?
@Morran, There are many levels that can be improved on (that can be completed in less moves) which I have yet to conquer.
No. That cannot be right. Not enough room to do it that way (not even without the seperator). You must be converting the score somehow. But then, why does it only save values up to 999 and not higher? There are 10 to 12 levels that took more than 999 moves to complete, yet the saved score is set to 999.
@danpost: UserInfo is designed to have only one highscore but I obviously needed one highscore for each level. To work around this limitation I use all available ints and Strings to store the users moves for each level (like you assumed).
I do not use a seperator. In an int I store 3 levels with 3 digits. In a String I store 15 levels with 3 digits. With the available 10 ints and 5 Strings I can save up to 105 levels.
The limit is 999 moves because of the max of 3 digits.
If you have an elegant idea how to work around the 999 moves limitation - I'd be glad to know.
Oh - just had an idea as I wrote the comment above:
I could save up to 16 bits in a single character. This means a maximum value of 65'535! So it would be possible to save 50 levels with a max. of 65'535 moves in each String. Maybe I'll do that in a later version.
That was my thought, exactly. Just using the Strings, you can save 250 levels of scores up to 65'535! That is exactly the kind of thing I had in mind for one of my projects.
That was my thought, exactly. Just using the Strings, you can save 250 levels of scores up to 65'535! That is exactly the kind of thing I had in mind for one of my projects.
It appears we were assuming to much, royalfool. Excel is too stringent on how text is stored and will not store the values as we thought. My Private Messaging scenario may eventually fail for new users (plus one older); but, I believe that would probably be years from now. Before then, I will have to do some testing and add code to prevent failure. Will inform you of the limitations when I have figured them out.
It is too bad that Excel is this way, as that totally blows my intensions for using UserInfo in one of my projects (not enough storage to make it feasable, at least in the way I wanted to use it).
It seems that the only characters supported by the UserInfo Strings are in the range of 0 to 255. There are even some of those that will not store; namely, 13 (carriage return character) and those in the range of 128 to 159, inclusive (not sure why). That leaves only 223 different characters that can be stored (not much to work with).
With the above in mind, you can save integers up to 48'728 in a two character string. This would allow you enough room for 125 puzzles whose scores are stored only in the 5 strings. If you are interested in the conversion code (both ways), start a discussion.
@danpost: Would be great if you could share the conversion code. I started a discussion at http://www.greenfoot.org/topics/1983
A new version of this scenario was uploaded on Tue Sep 11 20:00:44 UTC 2012
Highscore limit of 999 moves removed.
Added three new levels.
A new version of this scenario was uploaded on Tue Sep 11 20:08:51 UTC 2012
change legacy moves of 999 to 9999 (in some levels it's not possible to have below 999 moves!)
A new version of this scenario was uploaded on Tue Sep 11 20:12:13 UTC 2012
change legacy moves of 999 to 9999 (in some levels it's not possible to have below 999 moves!)
A new version of this scenario was uploaded on Tue Sep 11 20:28:22 UTC 2012
Fixed little problem with the highscore of the last three levels...
I am not sure what is going on. I had bettered the score of 1356 on level 103 at least four times and the high score for that level does not change. Oh, and yes, I was signed on each time. The scores were 1338, 1296, 1294, and 1300.
@danpost: Thanks for reporting this. I've tried to find the problem but couldn't so far. It's quite difficult to debug since UserInfo still has the character set issue when run locally (http://www.greenfoot.org/topics/1983). I might need to wait until a new version of Greenfoot is released until I can properly debug this issue.
Still a question: Were you able to improve your score in other levels? Also with moves above 1000?
ups, got an error:
0
CacheEntry[http://www.greenfoot.org/applet_attachments/0000/4167/greenfoot8802562908424006311.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:50:35 CEST 2012,length=55893
CacheEntry[http://www.greenfootgallery.org/sharedjars/Greenfoot-core-2.1.0.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:49:55 CEST 2012,length=254236
CacheEntry[http://www.greenfoot.org/sharedjars/Greenfoot-core-2.1.0.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:49:55 CEST 2012,length=254236
CacheEntry[http://www.greenfoot.org/sharedjars/Greenfoot-core-2.4.jar]: updateAvailable=false,lastModified=Mon Sep 10 12:41:30 CEST 2012,length=283213
CacheEntry[http://www.greenfoot.org/sharedjars/jl1.0.1.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:49:55 CEST 2012,length=143160
CacheEntry[http://greenfootgallery.org/sharedjars/Greenfoot-core-2.2.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:49:55 CEST 2012,length=288137
CacheEntry[http://greenfootgallery.org/sharedjars/jl1.0.1.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:49:55 CEST 2012,length=143160
CacheEntry[http://www.greenfoot.org/sharedjars/Greenfoot-core-2.2.jar]: updateAvailable=false,lastModified=Fri Aug 17 13:49:55 CEST 2012,length=288137
Attempting to reconnect to storage server
java.security.AccessControlException: access denied ("java.net.SocketPermission" "129.12.3.237:8888" "connect,resolve")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at greenfoot.platforms.standalone.GreenfootUtilDelegateStandAlone.ensureStorageConnected(GreenfootUtilDelegateStandAlone.java:228)
at greenfoot.platforms.standalone.GreenfootUtilDelegateStandAlone.getTopUserInfo(GreenfootUtilDelegateStandAlone.java:456)
at greenfoot.util.GreenfootUtil.getTopUserInfo(GreenfootUtil.java:907)
at greenfoot.UserInfo.getTop(UserInfo.java:286)
at ServerHighscore.isAvailable(ServerHighscore.java:52)
at GameScreen.prepare(GameScreen.java:120)
at KaraWorld.<init>(KaraWorld.java:95)
at GameScreen.<init>(GameScreen.java:77)
@dibo, I wonder if that is a personal problem. When, exactly, did this error occur (during compilation, after starting, after you clicked on a particular button, etc.)
Yesterday the error occurred during loading the scenario. Now the scenario is running well. I think it might be a problem with the greenfoot server ("ServerHighscore.isAvailable").
2012/7/13
2012/7/14
2012/7/14
2012/7/29
2012/7/29
2012/7/29
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/7
2012/8/8
2012/8/8
2012/8/8
2012/8/8
2012/8/30
2012/9/1
2012/9/1
2012/9/4
2012/10/12
2012/10/12
2012/10/18
2013/2/6
2014/1/10
2014/1/10
2014/1/11