Thursday, 20 February 2025

Primus Mimer Stove and other burning issues

Primus Mimer Stove

Since the few attempts with spirit, I have switched to the cleaner gas burners. Despite not planning to go this route, I now have two of them.

Comparisons between gas and spirit aside, I'll focus on the Primus Mimer Stove, which was inviting with its wide-format gas burner element – no more blowtorching the middle of a frying pan?

This is one of the models which directly connect to the gas canister, and at 205 grams it could be considered an ultra-light solution. That is, if I don't carry the Trangia pieces around. The other burner weighs 180g but in practice requires the Trangia windshield ecosystem.

Still shiny and speckless

Although the gas worked for heating water quickly, it began sputtering when more was required, a 10-minute ordeal of cooking pasta. In fact the flame died on occasions and required reigniting. At first this seemed to be due to wind, another theory was that gas canister was growing colder.

Trying another burner with smaller element showed that perhaps the gas in itself wasn't to blame. I guess the wide-format elements are more susceptible to problems in this weather, and it's not an accident the elements are smaller in most models. But this is all rather thin speculation from this one experience.

Primus Mimer Stove in action

It was still possible to finish, but it is clear this combination is not for winter cooking, not even in this mild -1°C weather. The Primus Mimer instructions do not say anything about winter use, but there's a symbol on the box that suggests it's a "3 season" solution.

Ultimately the frying pan was not even tried in this session, even though it was one motive for getting this burner. This will have wait for better conditions or at least more appropriate gas.

In sunlight it wasn't possible to see the flame, which is understandable, but there were times I couldn't even hear it, which was a strange sensation. Most of the time Primus did give the usual, reassuring noise.

The shores of Arabia

Some other considerations: the gas adjustment valve is positioned quite close to the center of the burner, but in practice this wasn't really a problem. Still, a better placed adjustment knob might have been welcome.

Balance is another slightly worrying thing when working with this type of burner. You have to be careful when prodding the food, as the stack certainly isn't as sturdy as a Trangia-type windshield contraption.

Chair and the carry bag

Another item which I've had for a while, is a collapsible chair. Robens' Geographic High Silver Grey promised light weight and easy operation, and on those counts it delivers.

At 370 grams, the trade off is that it's on the small side, but fortunately I am not super-huge and still weigh less than 90kg, far from the suggested maximum 120kg capacity.

Not saying it is perfect, and I'm still collecting experiences, but I've been able to forget about it while sitting and that is a good sign. It also hangs nicely from the bag, adding very little to total encumbrance.

A random dog I couldn't see while shooting.

The session took place in Kuusiluoto in Helsinki, a popular spot for wintertime outdoor activities. We took the route back over ice. This felt a little suspicious at first given the mild winter, but so many people were crossing it, it was obviously not likely to break.

Sunday, 16 February 2025

ZX Spectrum and ChatGPT

I used ChatGPT (free version) to create a ZX Spectrum BASIC quiz game. I did not adjust the code afterwards at all.

I saw a few attempts at using ChatGPT in the ZX Spectrum Facebook group, where the consensus looked like "impressive, but we're not there yet". The LLM had failed to understand the Sinclair BASIC dialect, so although the logic of the simple programs could be sound they would not run on a Speccy.

But I figured, well, ChatGPT can be instructed to avoid the mistakes?

What I set out to do is a quiz game where the computer gives a name of an U.S. president, and the player has to know or guess when he was first elected.

I first made ChatGPT produce a list of presidents and the election year. As the result had some ambiguities and complexities, I asked to simplify the list so there are only first-time election years and no problem cases.

Then I asked it to format the list into ZX Spectrum DATA statements, starting from the line 1000, with 10 increments.

Only after seeing this list was formatted correctly, I asked ChatGPT to prepend the list with a Quiz-type BASIC game.

Although you can ask ChatGPT to use ZX Spectrum BASIC, this is not enough and the result is likely to be more generic BASIC dialect.

So, it is better to give a set of iron rules. Instead of trying to teach the peculiarities of Sinclair BASIC, I simplified the orders further, to avoid getting ChatGPT confused or produce something that would be difficult to debug. For example, dimensioned strings could be difficult to handle, as they work differently in the Spectrum.

bas2tap converts plain text listings into a Spectrum emulator TAP file. It's quite pedantic (i.e. accurate) so some of the rules below address this issue too. Bas2tap is an important tool as otherwise it would be too slow to test the listing, now I can just copypaste the ChatGPT output to a text file and run a command from terminal.

So, after outlining the game program, I told ChatGPT:


Remember that ZX Spectrum BASIC follows these rules:

-Use only one-letter length for variable names, and dimensioned variable names.

-Do not use IF-ENDIF reaching on multiple lines. Each IF-THEN part must only happen on one line.

-Do not use END. Use STOP instead.

-When assigning a (non-dimensioned) variable, you need to explicitly use LET

-When using GOTO or GOSUB, use GO TO and GO SUB instead.

-Do not use dimensioned strings. This could be achieved by looping and reading the DATA list for each  item. e.g. RESTORE can reset the reading of the DATA list.

-The first element of a dimensioned array is 1, not 0.


You could also forbid it using RANDOMIZE, as chatGPT may use it to reset the random seed, which is not really necessary.

That point about dimensioned strings and data lists is only relevant if the program has to go through a data list in the first place.

The game itself is quite silly, as I gave rather silly instructions to ChatGPT. You get to guess presidents, but if you fail it will tell you the year. The game ends if you guess one president right. Well, that's not a huge problem.

The way the program works is also a little quirky, but this too is to be blamed on the instructions I had given to ChatGPT. The program stores the year values to an array, but not the names. So it will have to scan the DATA statements again to get the name.

What I liked most about this exercise was how I could populate the data table so fast and easy, making a potentially boring task a wheeze. Granted, a list of presidents could be googl-eyed, or acquired from Wolfram Aplha, but there's still dullness in cleaning up and reformatting the results to DATA lines suitable for the limitations of this particular listing.

The listing: (Ok I did remove line 10 that had the unnecessary RANDOMIZE)


20 DIM Y(40)
30 PRINT "PRESIDENT QUIZ! GUESS THE YEAR A PRESIDENT WAS FIRST ELECTED."
40 LET S=1000
50 RESTORE S
60 FOR I=1 TO 40
70 READ A$, B
80 LET Y(I)=B
90 NEXT I
100 LET Q=INT(RND*40)+1
110 RESTORE S
120 FOR I=1 TO Q
130 READ A$, B
140 NEXT I
150 PRINT "WHAT YEAR WAS ";A$;" ELECTED?"
160 INPUT A
170 IF A=Y(Q) THEN PRINT "CORRECT! WELL DONE!": GO TO 200
180 PRINT "WRONG! THE CORRECT YEAR IS ";Y(Q)
190 PRINT "LET'S CONTINUE.": GO TO 100
200 PRINT "DO YOU WANT TO PLAY AGAIN? (Y/N)"
210 INPUT B$
220 IF B$="Y" OR B$="y" THEN GO TO 100
1000 DATA "George Washington", 1788
1010 DATA "John Adams", 1796
1020 DATA "Thomas Jefferson", 1800
1030 DATA "James Madison", 1808
1040 DATA "James Monroe", 1816
1050 DATA "John Quincy Adams", 1824
1060 DATA "Andrew Jackson", 1828
1070 DATA "Martin Van Buren", 1836
1080 DATA "William Henry Harrison", 1840
1090 DATA "James K. Polk", 1844
1100 DATA "Zachary Taylor", 1848
1110 DATA "Franklin Pierce", 1852
1120 DATA "James Buchanan", 1856
1130 DATA "Abraham Lincoln", 1860
1140 DATA "Ulysses S. Grant", 1868
1150 DATA "Rutherford B. Hayes", 1876
1160 DATA "James A. Garfield", 1880
1170 DATA "Grover Cleveland", 1884
1180 DATA "Benjamin Harrison", 1888
1190 DATA "William McKinley", 1896
1200 DATA "Theodore Roosevelt", 1904
1210 DATA "William Howard Taft", 1908
1220 DATA "Woodrow Wilson", 1912
1230 DATA "Warren G. Harding", 1920
1240 DATA "Calvin Coolidge", 1924
1250 DATA "Herbert Hoover", 1928
1260 DATA "Franklin D. Roosevelt", 1932
1270 DATA "Harry S. Truman", 1948
1280 DATA "Dwight D. Eisenhower", 1952
1290 DATA "John F. Kennedy", 1960
1300 DATA "Lyndon B. Johnson", 1964
1310 DATA "Richard Nixon", 1968
1320 DATA "Jimmy Carter", 1976
1330 DATA "Ronald Reagan", 1980
1340 DATA "George H. W. Bush", 1988
1350 DATA "Bill Clinton", 1992
1360 DATA "George W. Bush", 2000
1370 DATA "Barack Obama", 2008
1380 DATA "Donald Trump", 2016
1390 DATA "Joe Biden", 2020