![]() |
#1 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Popeye - A chess problem solving program - now ported to Kindle!
General:
Popeye solves chess problems - both orthodox and in fairy chess(using different rules for stipulations, pieces and conditions). It's a CLI program, which accepts input from a text file or keyboard(the position to be solved) and after solving it, sends the results to the screen and/or a text file. Porting History: It was originally written in the early 1980s, in a Pascal dialect, and ran on MS-DOS. It was later re-written in C and ported to run on Unix, Windows, OS/2, VAX VMS, IBM MVS, SIEMENS BS2000, MacOS, and Linux. Recently it was ported to Android and iOS by re-writing it in asm.js - a subset of JavaScript. This allowed it to run under any browser supporting JavaScript. (http://matplus.net/start.php?px=1483...&fid=it&page=0) However, the port didn't work in the Kindle browsers. So I made a series of posts in another thread here (https://www.mobileread.com/forums/sh...4&postcount=22), intending to start an ARM specific native port which would work on the Kindle command line. After seeing my posts, member encol kindly did a quick porting with his Kindle development setup(https://www.mobileread.com/forums/sh...8&postcount=30). Many thanks to him! I have re-attached the executable created by him to this post. Only renaming it from "py" to "popeye". Instructions: 1. Your Kindle should be Jailbroken 2. kterm should be installed 3. Download the attached executable ("popeye") 4. Extract it to any suitable folder under /mnt/us 5. For running it, open kterm, navigate to the directory where it was extracted and type "./popeye" 6. Popeye now displays version and memory information and expects you to enter the position to be solved, using the protocol defined in the help file 7. Alternatively you can enter and save the position in a text file in the same folder as popeye. And then run it as "popeye xyz.txt", where"xyz.txt" is the file containing the position 8. After solving the position, popeye displays the solution on the screen. It can also be made to save the solution to a text file by specifying this in the input. Help File: The Popeye help file contains exhaustive instructions, covering all the possible options: https://github.com/thomas-maeder/pop...75/py-engl.txt Other help sources: More visual instructions may be found here: http://juliasfairies.com/software/po...-and-examples/ http://juliasfairies.com/software/po...to-run-popeye/ http://juliasfairies.com/software/popeye/bscripts/ These are windows specific but can easily be adapted to a linux setting. History: An overview and a development history are here: http://juliasfairies.com/software/popeye/ http://juliasfairies.com/software/po...ory-of-popeye/ Source code: The source code can be seen here: https://github.com/thomas-maeder/popeye/releases/ Tried on: Has been tested on PW1, PW3 and KT3. Should work on other models too. EDIT (7-Jan-2017): KUAL extension added! Instructions: Extract the attached zip file "popeye_kual.zip" into /mnt/us/extensions Create and save a position for solving in the specified format, as /mnt/us/extensions/popeye/files/inp.txt. You can use leafpad Run KUAL. Popeye should now appear in the menu list Run Popeye. Popeye takes the position in the file /mnt/us/extensions/popeye/files/inp.txt and solves it It then displays the solution. After this, you can swipe to scroll up/down to see the complete output and then press any key to exit In addition, the output is appended to the file /mnt/us/extensions/popeye/files/out.txt. You can browse through this to see the solutions of all the positions solved The input file, obviously will get over written by the user, when he creates and saves a new position. For this, the input file is appended to /mnt/us/extensions/popeye/files/inp_bak.txt Initially, there is a famous 3-mover by Sam Loyd saved in both the input and output files. You can run this first, if you like Screenshot from KT3 added EDIT (11-July-2017): New version v4.77! Instructions: Extract from attached zip(popeye_v477.zip) and replace earlier version Changes from previous version: Spoiler:
Last edited by nasser; 07-11-2017 at 05:17 AM. Reason: New version |
![]() |
![]() |
![]() |
#2 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The text file ...
The Kindles ship with the Busybox version of vi pre-installed. The USBnetworking package includes a build of nano. Both should work from the kTerm command line. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Quote:
1. Leafpad 2. Vim 3. Midnight Commander internal editor |
|
![]() |
![]() |
![]() |
#4 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
I'm trying to make a KUAL button.
I got it OK, but after displaying the output, the window closes. I tried to make the shell script pause for a key press by putting a "read -p" command, but it didn't work. Any ideas? |
![]() |
![]() |
![]() |
#5 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
you must use kterm -e
See midnight commander kual extension |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
encol, I've done that. The commands in popeye.sh are:
Code:
#!/bin/sh cd /mnt/us/extensions/popeye/bin /mnt/us/extensions/kterm/bin/kterm -e"./popeye ./inp.txt" read -p "Press any key to exit" |
![]() |
![]() |
![]() |
#7 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 416
Karma: 765432
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
|
try to insert a space between after -e, like this:
Code:
/mnt/us/extensions/kterm/bin/kterm -e "./popeye ./inp.txt" |
![]() |
![]() |
![]() |
#8 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Did that too. The screen simply refuses to remain open. Maybe, just redirect the output to a text file in /mnt/us/documents, so that the user can see it at his convenience.
|
![]() |
![]() |
![]() |
#9 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
The stock reader, for files in /documents, a file ending in .txt is assumed to be (and handled as) html with a rather funky css built-in.
This is an Kindle reader ??feature??/??bug?? <- your choice of term. |
![]() |
![]() |
![]() |
#10 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
Solved! Created a separate "run_popeye.sh" script which actually calls the executable and has a "read -p" command which waits for a keypress. This script is called by the main "popeye.sh" script via kterm.
|
![]() |
![]() |
![]() |
#11 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
KUAL extension and KT3 screenshot added to opening post!
|
![]() |
![]() |
![]() |
#12 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
|
New version 4.77!
Added to opening post. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Glo Chess program | kalimero | Kobo Reader | 21 | 02-18-2016 05:05 PM |
Design and Development of Android Applications:Android Apps Solving Real Problem | amazon author | Self-Promotions by Authors and Publishers | 0 | 04-03-2015 04:01 AM |
Free (nook/Kindle) Professional Guide to Decision Science & Problem Solving [Business | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 3 | 12-17-2012 01:34 PM |
The Broken Kindle Problem: An Aid Program Runs Into Trouble | SteveEisenberg | Amazon Kindle | 1 | 05-11-2012 11:40 PM |
Solving problem with noise | Malder1 | iRex | 3 | 10-16-2006 04:37 AM |