Post Reply 
Two Contributions to the User's Program Library Europe (UPLE)
05-07-2024, 02:09 PM
Post: #1
Two Contributions to the User's Program Library Europe (UPLE)
It has been a while that I came across two contributions to the UPLE and another Chess program for the HP-41C.

These programs were written by Dutch gentlemen.

I don't know if the contributions to the UPLE officially made it into the library - these are not the numbered documents you would receive FROM the library but the forms you sent TO the library.

The two UPLE contributions:
https://www.mh-aerotools.de/downloads/HP...ersion.pdf
https://www.mh-aerotools.de/downloads/HP...20Word.pdf

The Chess program (I hope it is o.k. to make them available, even if "Nadruk verboden" ;-) maybe someone wants to translate the text into English?)
https://www.mh-aerotools.de/downloads/HP...0Dutch.pdf

Martin
Find all posts by this user
Quote this message in a reply
05-09-2024, 09:37 AM
Post: #2
RE: Two Contributions to the User's Program Library Europe (UPLE)
Regarding the base-conversion program, I might offer the following, an explanation and a binary-to-decimal program which, although only for the one pair of bases, is much simpler, and can be modified for other bases.  I posted it on the forum of the other site when someone asked for such a thing.
-------------------------------
Quote:I can't take the time right now to write a program, but the Advantage module has the conversion built in, and it runs with no visible delay.

However, here's an explanation of how to do such a conversion, simplified not quite to the point of lying.  LOL  It should give the basic understanding so you can write suitable routines.  For inputting numbers from a text string (e.g. typed in from a keyboard), initialize a number as 0 to build on, then take the first digit in the string and add its value to the decimal number you're building.  Continue until you're out of digits, each time multiplying the build by 10 and then adding the new digit's value to the build.  If you encounter a decimal point, keep track of how many digits were after it.  In the Forth programming language, the decimal point automatically makes the result double-precision; but you can convert back to single if you want to.  If there was a minus sign, record that too.  Forth uses the same routines to convert to and from any base, with the desired base being in a variable called BASE, and it's just as easy to convert to and from base 3 or 7 or 11 for example as it is to convert to and from base 2 or 8 or 10.  (Internal representation is hexadecimal.)  It's not the fastest method, but it's short and works for any base.

For converting numbers to other bases for output (which will normally be a string), initialize a blank string.  You will build it from right to left.  Divide your number by what's in variable BASE, and use the remainder to add a text digit to the build, even if it's a 0.  Keep doing that until there's 0 in the number.  You can add a decimal point or other characters between digits, e.g. 12.345 or 12:36:40 (actually you might want to change BASE from 10 to 6 and back for the time readout, if you started with a number of seconds!)

The way Forth does this output number formatting is somewhat explained starting at about the middle of the page of chapter 5 of Leo Brodie's "Starting Forth" (with ANS updates here, and they're mostly calling single-precision 32-bit).

and then later:

Quote:Ok, I was able to take a few minutes and write one.  Start with the binary number in ALPHA (all valid digits for the desired base, so in this case only 0's and 1's, no spaces), then execute the program.  At the end, the result will be in X.

Code:

LBL "B2D"   \ I called it "B2D" for "Binary To Decimal"
LBL 00
  ALENG     \ How many characters?
  .00001    \ This is for the DSE function for loop control.
  +
  STO 00
  0         \ Initialize the number we'll build upon as 0.
LBL 01
  2         \ This is the base you want to convert from.
  *         \ Multiply the previous result by the base.
  ATOX      \ Get the left-most character in ALPHA.  Must be valid.
  48
  -         \ Subtract the ASCII value of "0",
  +         \ and add the result to the number we're building.
  DSE 00    \ Decrement the loop counter and compare to the number of characters.
  GTO 01    \ If we're not done, go back for another lap.
  RTN

I've tried it for numbers up to 111111111111111111111111 (24 1's, which is the maximum number of characters accepted in ALPHA), which gives an answer of 16,777,215, or $FFFFFF.  After seeing how it works, you can modify it for other bases, skip leading spaces, stop when it encounters an invalid character, use a text file (which allows longer strings) or strings in two sections to get more binary input digits, etc., to make it more versatile.

http://WilsonMinesCo.com  (Lots of HP-41 links at the bottom of the links page, at http://wilsonminesco.com/links.html#hp41 )
Visit this user's website Find all posts by this user
Quote this message in a reply
05-14-2024, 12:01 PM
Post: #3
RE: Two Contributions to the User's Program Library Europe (UPLE)
(05-07-2024 02:09 PM)Martin Hepperle Wrote:  The Chess program (I hope it is o.k. to make them available, even if "Nadruk verboden" ;-) maybe someone wants to translate the text into English?)
https://www.mh-aerotools.de/downloads/HP...0Dutch.pdf

This one could be interesting, although judging by the program size it cannot be a complete chess-playing game (hope I'm wrong). I'm hoping our Dutch-speaking fellows can lend a helping hand with the translation (Meindert, you there?

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
05-27-2024, 06:47 AM (This post was last modified: 05-27-2024 05:19 PM by Ángel Martin.)
Post: #4
RE: Two Contributions to the User's Program Library Europe (UPLE)
Using OCR and deepl.com I've prepared a very crude translation of the original text. The copy wasn't very clean so tons of OCR issues as you can expect - I even had to type some paragraphs by hand, more potential errors right there. Worse yet, the original text is loaded with abbreviations and colloquial expressions that the translator wasn't capable of digesting properly (and I thought German was difficult...)

So it'll really benefit from a Dutch native speaker's review to clarify/correct all those funny choices (like "irradiation" , wtf?)

Two files are attached, one with the Dutch text and another with the crude translation. in this one I've also included a board initialization routine to ease the loading burden, but I'm yet to attempt a chess game - slow train coming...

Cheers,
ÁM

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
05-27-2024, 09:29 AM
Post: #5
RE: Two Contributions to the User's Program Library Europe (UPLE)
Even for native Dutch speakers the text is a challenge ;-)
And it really says (ir)radiated in Dutch, I'm afraid, meaning the squares covered/reached by a piece.
I made a start with the first paragraph, but already the last phrase there, I have no idea what he means.. don't hold your breath..
Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
05-27-2024, 11:39 AM (This post was last modified: 05-28-2024 12:56 PM by Ángel Martin.)
Post: #6
RE: Two Contributions to the User's Program Library Europe (UPLE)
Great to have your help here Werner...for sure the text is dense and thick, and the author was enthusiastic to describe his achievement...but can you perhaps tell me what's the meaning of the following abbreviations:

zw. (alternatively?)
c.q.
aangev.
b.v. (before??)
v.e. (for example?)
alg. (several?)
v.d. (for the?)
v.h. (for the?)
vig. (???)
evt. (eventually?)
d.w.z. (???)

Thanks,
ÁM

PS/ attached is a MOD file with the JCH80 program and the initialization JCINI in case there are some volunteers to take it for a spin (you can ignore the Hexapawn and Knight also in the FAT as they're not related to this.)

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
05-27-2024, 03:16 PM (This post was last modified: 05-27-2024 03:19 PM by Martin Hepperle.)
Post: #7
RE: Two Contributions to the User's Program Library Europe (UPLE)
Hah,
I see that I created a puzzle ...

I try a few of the abbreviations (artificial intelligence was only of little help here...):

(05-27-2024 11:39 AM)Ángel Martin Wrote:  [...]

zw. (alternatively?)
Z/W --- Schwarz/Weiss --- Black/White
c.q.
aangev.
b.v. (before??) --- German: "z.B." zum Beispiel --- English: "e.g.", "for example"
v.e. (for example?) ---German "von einer" --- English "of a"
alg. (several?) --- German: "allgemein" --- "general"
v.d. (for the?)
v.h. (for the?)
vig. (???)
evt. (eventually?)
d.w.z. (???) --- German "d.h.", "das heisst" --- English "which means", "i.e.", "that is"

[...]

The text "The pieces zw. neg., white pos. are... " should probably read "the pieces (black: negative, white: positive) are..." decribes the sign conventions used for the contents of the 64 registers.
Find all posts by this user
Quote this message in a reply
05-27-2024, 03:20 PM
Post: #8
RE: Two Contributions to the User's Program Library Europe (UPLE)
Maybe these sites can helps ...

Sylvain Côté
Find all posts by this user
Quote this message in a reply
05-27-2024, 05:18 PM (This post was last modified: 06-07-2024 04:55 AM by Ángel Martin.)
Post: #9
RE: Two Contributions to the User's Program Library Europe (UPLE)
Thanks Werner and Sylvain, got a handful from those lists but it appears the author abbreviated his way away up and above the vernacular standards...

Ive made a few assumptions and updated the English translation to a point where I believe it can now be used to play some moves (the program description is very deep but not really necessary to just play it, I think...)

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
05-28-2024, 06:42 AM
Post: #10
RE: Two Contributions to the User's Program Library Europe (UPLE)
(05-27-2024 11:39 AM)Ángel Martin Wrote:  Great to have your help here Werner...for sure the text is dense and thick, and the author was enthusiastic to describe his achievement...but can you perhaps tell me what's the meaning of the following abbreviations:

zw. (alternatively?)
c.q.
aangev.
b.v. (before??)
v.e. (for example?)
alg. (several?)
v.d. (for the?)
v.h. (for the?)
vig. (???)
evt. (eventually?)
d.w.z. (???)

                     Dutch                English
zw. (alternatively?) zwart                black
c.q.                 casu quo             in case, specifically
aangev.              aangevallen          attacked
b.v. (before??)      bij voorbeeld        e.g. , for instance
v.e. (for example?)  van een (stuk)       of a (piece)
alg. (several?)      algemeen             overall
v.d. (for the?)      van de (koning)      of the (King)
v.h. (for the?)      van het (programma)  of the (program)
vig. (???)           vlg: volgens (mij)   according to (me)
evt. (eventually?)   eventueel            possibly (false friend!)
d.w.z. (???)         dit wil zeggen       meaning


Had to look up c.q. myself - never heard of it.
and yes, eventueel ^= eventually ;-)

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
05-28-2024, 11:41 AM
Post: #11
RE: Two Contributions to the User's Program Library Europe (UPLE)
(05-28-2024 06:42 AM)Werner Wrote:  Had to look up c.q. myself - never heard of it.

I remember seeing it occasionally, but that was a long time ago. I guess it fell out of favor, and I'd say that's just as well, because people couldn't agree on what it meant. As I remember it, it usually meant "or" or "or otherwise." Or in Dutch: "of" or "danwel." No idea what possessed people to abbreviate such short words in the first place.

https://onzetaal.nl/taalloket/cq
Visit this user's website Find all posts by this user
Quote this message in a reply
05-29-2024, 05:18 AM (This post was last modified: 05-29-2024 08:33 AM by Ángel Martin.)
Post: #12
RE: Two Contributions to the User's Program Library Europe (UPLE)
Thanks guys, with these reinforcements I believe we've now got a workable translation done. It still has some idiosyncrasies but mostly due to the kind of description used , very much into the implementation details and taking quite a lot for granted. As for why abbreviating short words using equally long or even longer expressions, well I'm afraid scholars are at fault... the attraction of Latin and old class is strong!

The good news is it's working almost as advertised, although with some quirks that I'm trying to iron out. The program flow differs from the description in a couple of areas, which are those where the results look strange. Needless to say it won't win the prize for speed and finesse but the fact that it is capable of playing a game of Chess is nothing short of wonderful for that machine. It's amazing that the program was buried during over 40 years without much mention to it at all (surely the local flavor restricted distribution, but still...), thankfully Martin dug it up from those sands of time.

I've written a couple of routines to do conversion between the field numbers used by the program (to identify the squares on the board) and a coordinate convention, more usual and easier to use. Also I have reused a handy MCODE routine to input the white moves using the coordinate convention - ensuring that only proper values are entered (E2-E4, etc.) The final version is almost ready, will make it available ASAP.

Best,
ÁM

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
06-10-2024, 10:26 AM
Post: #13
RE: Two Contributions to the User's Program Library Europe (UPLE)
Update: Well, not so good news I'm afraid.

The field# <-> coordinates routines work just fine, so the data input is using the familiar A-H, 1-8 conventions. Game initialization is now also automated.

A couple of gray areas remain unclear, like the opening option - very confusing (read: not documented) and possibly not working as intended. Also there's no information provided about pawn promotion or castling, although the problems start much earlier than that.

The program is making some invalid moves here and there, either wacko jumps or sometimes illegal field codes used as source/destination.

After quite an extensive review I'm not sure I can get to the bottom of these issues, so I'm pausing my research for the time being, sorry. I may do another attempt in a few days or so...

The attached module includes the result of my work so far, in case somebody wants to take a look...
LBL "JCH80" is the main program and also he starting point via XEQ "JCH80".
The program always plays black (not changeable). White pieces located in rows #1 and #2, white square (H1) to the right, white queen on its color (D1).

I meant to pit it against the (more powerful) CH136 (LBL "CHESS", also in the module and yes this one plays just great) , but it doesn't get pass the fourth or fifth move depending on the games, very disappointing.


Attached File(s)
.zip  CHESS.zip (Size: 8.87 KB / Downloads: 2)

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
06-10-2024, 12:17 PM
Post: #14
RE: Two Contributions to the User's Program Library Europe (UPLE)
(06-10-2024 10:26 AM)Ángel Martin Wrote:  Also there's no information provided about pawn promotion or castling
As far as I understand, castling is done moving the rook 'manually' ie. clearing its field and placing it straight in the correct register, then entering the King's move (by two squares).
Promotion is also done manually, and there's no guard against illegal moves.

Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 




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