![]() |
#106 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Wow, that was all? Thanks, @Surquizu! I hope you enjoy the game.
Now I'm off to see if it will work on my 600! Ben. |
![]() |
![]() |
![]() |
#107 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Actually, it turned out to be slightly more than that. I had to remove a 'try... catch' in the PRS+ activation script (FreeCell.js). Then it worked fine in my PRS+ 2.0.x custom build:
I changed Code:
try { kbook.autoRunRoot.sandbox.getSoValue = Core.system.getSoValue; kbook.autoRunRoot.sandbox.hasNumericButtons = Core.config.compat.hasNumericButtons; } catch (ignore) {} Code:
kbook.autoRunRoot.sandbox.getSoValue = Core.system.getSoValue; kbook.autoRunRoot.sandbox.hasNumericButtons = Core.config.compat.hasNumericButtons; Thanks, Ben. P.S. I've updated the attachment in post #104 |
![]() |
![]() |
Advert | |
|
![]() |
#108 |
2B || !2B
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 853
Karma: 314486
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
|
distorted cards-display with PRS-505
Hi,
I just want to report, that Frecell on my PRS-505 shows some distorted cards. You can also notice this in the screenshot in surquizu's post #105. (and yes this is not only due to the jepg-compression of the screenshot) I'm just currious if this also happens with other eReaders? BTW: in the Sim there is no distortion! ![]() Last edited by Mark Nord; 01-04-2011 at 01:53 PM. Reason: Removed modified code to be discussed with Ben, see posts below |
![]() |
![]() |
![]() |
#109 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
How strange! No, I experience no such distortion on my 600. It looks just like it does in the Sim.
|
![]() |
![]() |
![]() |
#110 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
New version of Freecell
Hi everyone,
There's an update to Freecell. Mark Nord, tracked down the problem with the card distortion on the 505. He also made the digit buttons work on the 500/505 to move the cursor to specific rows. Mark also suggested that some sort of undo or snapshot facility would be nice. I had the time, so here's a version with a snapshot. Press PREV to open the snapshot and NEXT to save the snapshot. Sincerely, Ben. EDIT: Updated zip file after adding undo with depth of 10 moves. (Note that loading a snapshot resets the undo.) Press the SIZE/ZOOM button to undo the previous move. UPDATE: Latest version now found in post #145. Last edited by BenChen; 02-10-2011 at 08:02 AM. Reason: Zip filed move to post #145 |
![]() |
![]() |
Advert | |
|
![]() |
#111 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Just updated the zip file in the previous post. Freecell now has an undo feature with a depth of 10 moves.
|
![]() |
![]() |
![]() |
#112 |
2B || !2B
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 853
Karma: 314486
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
|
Great Thanks a lot!
|
![]() |
![]() |
![]() |
#113 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 411
Karma: 902071
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O, kobo Glo HD, kobo aura ONE
|
Running on my 505 integrated into the PRS + 1.1.3 (small changes in the FreeCell.js)
Thanks. |
![]() |
![]() |
![]() |
#114 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Does anyone know if the Javascript engine used by the PRS readers includes the setTimeout function? I would love to be able to use it, but initial trials in the Test Environment were not successful. (In pure Javascript the function is a method of the window object.)
|
![]() |
![]() |
![]() |
#115 |
2B || !2B
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 853
Karma: 314486
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
|
Hello Ben,
The "standard-JS" windows-object isn't available to our readers. But FSK features a <global>Timer Like used here in Fskin.dialog.autoClick taken from fskin.so Spoiler:
I havn't check yet, if Timer is scriptable or had to be addressed in compiled code. Maybe this can set you on track. PS: <global> has not to be typed in! PPS: take care to cancel() and delete the Timer properly, as a active Timer may prevent suspend-mode and thus drain the battery. Last edited by Mark Nord; 01-13-2011 at 02:29 PM. |
![]() |
![]() |
![]() |
#116 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Thanks for that. When I have some more time, I will give it a try.
|
![]() |
![]() |
![]() |
#117 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Sorry, Mark, I didn't understand what you meant by "PS: <global> has not to be typed in!"
This is what I have tried so far: Code:
this.engineTimer = new Timer(); this.engineTimer.onCallback = this.engineMove(); this.engineTimer.schedule(5000); What am I doing wrong? |
![]() |
![]() |
![]() |
#118 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
New game: Chess
Hi everyone,
I wanted to see if I could program a Chess game for the Sony Reader. Here's what I have so far. This version only works in 2-player mode. However, it includes castling and en passant, you can choose which piece you get when you promote a pawn, and it automatically detects checkmate and stalemate (although it doesn't detect the 50-move type, just the "while I am not currently in check, there are no legal moves" type.) Next step, if I have time (and I am not even sure that it is technically possible) is to include AI for a 1 player mode. We'll see.. Hope it works for you. It should work for both Touch and non-Touch readers (although it's pretty painful in non-Touch mode!) I have tested it successfully on my PRS-600. Sincerely, Ben. P.S. Updated to fix graphics issue with non-Touch readers, as well as incorporating Mark Nord's suggestions: buttons 1-8 now move cursor, which is no longer the "hand" icon. NEW UPDATE: I have added an initial implementation of Artificial Intelligence! If you press the SIZE button, the reader will make a move for whoever's turn it is. You can therefore play the white pieces, and then press SIZE so that the reader will move for black. Or you can press SIZE so that the reader will move for white, and then you play the black pieces. Alternatively, you can keep pressing SIZE to watch the reader play against itself! Note, though, that there is no automatic mode. You have to press SIZE each time to make an AI move. The fine print: the AI is not always very good, and it is quite slow. In "Slow mode", AI moves take between 30 and 60 seconds on my 600, and there is no indication that things are happening, so be patient! Also, I have noticed a rather nasty bug: check is not always recognised, or defended against, and the king can even move offensively into check. So if that happens to you, I am sorry! (Although, it can be fun to take the king and watch the game continue!) Since the AI was slotted into place (taken from p4wn on Sourceforge!) I don't think I will be able to track down these bugs... Alternatively, a completely different AI engine could be slotted in at a later stage. MINOR FIX: I have found a way to check for checkmate / stalemate no matter who moved last (human or AI), and so it should work in all situations now. (The AI may still move offensively into check, but you'll win as a result!) I have also changed the default AI speed to "Medium". The AI is good enough and the speed is much quicker than "Slow" mode. LATEST UPDATE: I have added an Auto Mode (thanks to code from Kartu!) which is on by default and a 1-level undo feature. The Auto Mode can be turned off using the NEXT button. It will cycle through the AI speeds (Auto On) then the AI speeds (Auto Off), etc. When Auto Mode is On, the reader will move Black. If you want to play the black pieces against the reader, turn the auto mode off, and use the SIZE button to force an AI move when it is White's turn. As for undo, the Undo button takes the board back to before the latest White move. So this is good for White, not so good for Black. (In other words, if White makes a silly move and Black takes advantage of it, Undo reverts to before White's move. If Black makes a silly move, and then White takes advantage of it, Undo only goes back to before White's move - that is, after Black's silly move.) If people don't like that, I guess I can go back and implement a proper 2-move reversal! TINY UPDATE: Undo now allows you to continue if your were in checkmate and you press undo. ANOTHER TINY UPDATE: If you force an white AI move when Auto if On, the reader will now automatically do the Black move as you would expect. UPDATE: Latest version now found in post #145. Last edited by BenChen; 02-10-2011 at 08:01 AM. Reason: Zip filed move to post #145 |
![]() |
![]() |
![]() |
#119 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 411
Karma: 902071
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O, kobo Glo HD, kobo aura ONE
|
Quote:
|
|
![]() |
![]() |
![]() |
#120 |
EPUB Metadata ******
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
|
Sorry to hear you are having problems. All I can suggest is do the opposite of what I did in post #107
Change Code:
kbook.autoRunRoot.sandbox.getSoValue = Core.system.getSoValue; kbook.autoRunRoot.sandbox.hasNumericButtons = Core.config.compat.hasNumericButtons; Code:
try { kbook.autoRunRoot.sandbox.getSoValue = Core.system.getSoValue; kbook.autoRunRoot.sandbox.hasNumericButtons = Core.config.compat.hasNumericButtons; } catch (ignore) {} Sincerely, Ben. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fsk error, code = -13 | Brian Charles | Sony Reader | 4 | 04-23-2010 04:21 PM |
Fsk error code= -43 | shrktank | Sony Reader | 1 | 12-24-2009 09:32 AM |
Just a silly tweak: AUTORUN.INF for Windows | Rootman | Kindle Developer's Corner | 3 | 12-04-2009 10:17 AM |
Request for test in Windows XP | kovidgoyal | Calibre | 5 | 08-26-2009 01:14 PM |
Windows Develpment Environment issue | itimpi | Calibre | 20 | 01-17-2009 07:15 PM |