Post Reply 
If I were to buy an LED model...
11-16-2019, 01:53 AM (This post was last modified: 11-16-2019 01:53 AM by Dave Britten.)
Post: #26
RE: If I were to buy an LED model...
Here's the ol' 15-puzzle solvability checker, ported pretty much directly from Don's 65 version. There are a couple of notable changes:

1. No labels, so all GTOs are line-number-based.
2. R/S doesn't terminate digit entry, so there's an ENTER in step 4 to explicitly terminate entry (otherwise the next step would modify X rather than lifting the stack first).
3. y^x isn't super precise, so the y^x call is followed by .5 + INT to round to the nearest integer.

To run it:

Enter the row number of the blank, press R/S, then enter the tiles left to right, top to bottom, with R/S after each one.

Code:
01    CLR REG
02    STO 2
03    R/S
04    ENTER
05    2
06    X><Y
07    y^x
08    .
09    5
10    +
11    INT
12    STO+ 1
13    RCL 1
14    X><Y
15    /
16    2
17    /
18    INT
19    STO 4
20    2
21    /
22    INT
23    STO 4
24    LASTx
25    FRAC
26    2
27    *
28    STO+ 2
29    RCL 4
30    X!=0?
31    GTO 20
32    RCL 2
33    R/S
34    GTO 04
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: If I were to buy an LED model... - Dave Britten - 11-16-2019 01:53 AM



User(s) browsing this thread: 1 Guest(s)