Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-04-2017, 01:31 PM   #1
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
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:
New features: Fairy condition Lost Pieces

Bug fixes:
  • ChineseChess: pawn promotion to chinese piece types absent from board was not possible
  • TransmutingKings didn't properly transmute to Queen because of an "optimisation"
  • NorskChess: castling must turn the rook into a bishop
  • Intelligent mode: option nocastling was mis-interpreted
  • twinnings by substitution weren't correctly taken back; subsequent twins were therefore handled incorrectly
  • "funny" solving behaviour in "battle play" problems with pawn promotions as defences
  • indication of the position: capital letters were not accepted as file indication (e.g. KA2)

Other fixes
  • clarified misunderstandings regarding Maximummer and BlackMaximummer in the docs and by producing an additional error message
  • help the user find erroneous piece indications (e.g. Xb1) with an added error message
Attached Thumbnails
Click image for larger version

Name:	screenshot_kt3.png
Views:	980
Size:	13.4 KB
ID:	154004  
Attached Files
File Type: zip popeye.zip (284.0 KB, 331 views)
File Type: zip popeye_kual.zip (286.7 KB, 375 views)
File Type: zip popeye_v477.zip (279.8 KB, 336 views)

Last edited by nasser; 07-11-2017 at 05:17 AM. Reason: New version
nasser is offline   Reply With Quote
Old 01-04-2017, 01:46 PM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
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.
knc1 is offline   Reply With Quote
Advert
Old 01-04-2017, 11:33 PM   #3
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by knc1 View Post
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.
Other options needing additional installs:
1. Leafpad
2. Vim
3. Midnight Commander internal editor
nasser is offline   Reply With Quote
Old 01-04-2017, 11:35 PM   #4
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
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?
nasser is offline   Reply With Quote
Old 01-05-2017, 03:10 AM   #5
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
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
encol is offline   Reply With Quote
Advert
Old 01-05-2017, 05:46 AM   #6
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Quote:
Originally Posted by encol View Post
you must use kterm -e

See midnight commander kual extension
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"
This works OK up to a point. The program runs, produces the output and displays it on the screen. But the requirement is that the window should remain open till the user presses a key. This doesn't happen. The window closes almost immediately after displaying the final line of the output.
nasser is offline   Reply With Quote
Old 01-05-2017, 05:56 AM   #7
encol
Evangelist
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
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"
encol is offline   Reply With Quote
Old 01-05-2017, 11:09 AM   #8
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
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.
nasser is offline   Reply With Quote
Old 01-05-2017, 12:39 PM   #9
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
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.
knc1 is offline   Reply With Quote
Old 01-05-2017, 01:41 PM   #10
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
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.
nasser is offline   Reply With Quote
Old 01-07-2017, 01:30 PM   #11
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
KUAL extension and KT3 screenshot added to opening post!
nasser is offline   Reply With Quote
Old 07-11-2017, 05:18 AM   #12
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
New version 4.77!
Added to opening post.
nasser is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:41 AM.


MobileRead.com is a privately owned, operated and funded community.