Live data from Hacker News

David Horne's 1K Chess on the ZX81 (2001)

thad.frogley.info

141–150 of 154 posts

Re: David Horne's 1K Chess on the ZX81 (2001)

#141
post #107

Earlier quoted context omitted.

please understand how weird it must be for me to watch someone be so dedicated to being wrong I sympathise, I'm having very much the same experience.

Yeah alright man, it's everyone else who is wrong. Damn.

Except that my original analogy has a lot of upvotes. But it is common enough to assume that the rest of the world agrees with you, when you think someone is wrong.

If, instead of trying the pissing contest, you could actually try to figure out why your "do you see why you're wrong", didn't, in fact, make me think I was wrong, we might get constructive. I think it didn't because it begged the question. Otherwise, piss away, it is funny to see how facile the 'yeah, no I'm right, because, I think so!' gets.

Re: David Horne's 1K Chess on the ZX81 (2001)

#142

Earlier quoted context omitted.

I strongly recommend playing with this sort of machine. It's an utter education. It will, literally, change the way you think about programming. Also, the ZX81 had the best cover art for any programming manual EVER: http://uknet.com/gallery2/d/16341-2/076_Sinclair_ZX81_Manual... (Paintings by John Harris. He sells prints! http://www.alisoneldred.com/thumbsJohnHarris-Prints-3-1.html ) However, you will be frustrated w…

> Also, the ZX81 had the best cover art for any programming manual EVER: Nope. http://globalnerdy.com/wordpress/wp-content/uploads/2007/09/...

That's... um... wow.

I think I shall resort to a strictly pedantic definition of the word 'best' here.

Re: David Horne's 1K Chess on the ZX81 (2001)

#143
post #121

Earlier quoted context omitted.

Oh my god - that's we we had line numbers ! To reduce parse complexity - FFS!!! That's amazing. Why am I so blind?

Not quite - line numbers were also the text editor.

They actually make for quite a decent IDE --- it's a really cheap and easy way to allow arbitrary insertion at any point without needing the complexity of a full text editor. You really need a RENUMBER command, though (which BBC Basic had) or else you sometimes find yourself unable to subdivide numbers.

Re: David Horne's 1K Chess on the ZX81 (2001)

#144

By the standards of the linked article I would say the greatest program is the original Elite game. A whole universe complete with star systems and 3D models for spaceships plus some other content like missions... I think the name says it: elite. All in 52 kb on disk.

Having disk available is cheating --- you get to load chunks of code off disk while the game runs!

Cassette Elite had to load the entire game into RAM. It had some omissions --- fewer ships, no (or fewer?) missions, no docking computer, etc. But it was completely self contained.

Source, BTW, is available from Ian Bell's website: http://www.iancgbell.clara.net/elite/bbc/index.htm

Here's an excerpt. It's machine code using BBC Basic's built in assembler as a cheapo macro assembler:

  7000.SHPPT JSREE51:JSRPROJ:ORAK3+1:BNEnono:LDAK4:CMP#Y*2-2:BCSnono:LDY#2:jsrShpt:ldy#6:ldaK4:ADC#1:jsrShpt:LDA#8:ORAXX1+31:STAXX1+31:LDA#8:JMPLL81+2:PLA:PLA:.nono lda#&F7:andXX1+31:staXX1+31:RTS
  7010.Shpt STA(XX19),Y:iny:iny:STA(XX19),Y:LDAK3:DEY:STA(XX19),Y:ADC#3:BCSnono-2:dey:dey:STA(XX19),Y:rts
  8040.LL5 \2BSQRT Q=SQR(RQ)
  8045LDYR:LDAQ:STAS:LDX#0:STXQ:LDA#8:STAT:.LL6 CPXQ:BCCLL7:BNELL8:CPY#&40:BCCLL7:.LL8 TYA:SBC#&40:TAY:TXA:SBCQ:TAX:.LL7 ROLQ:ASLS:TYA:ROLA:TAY:TXA:ROLA:TAX:ASLS:TYA:ROLA:TAY:TXA:ROLA:TAX:DECT:BNELL6:RTS
  8065.LL28 \BFRDIV R=A*256/Q
  8070CMPQ:BCSLL2:LDX#254:STXR:.LL31 ASLA:BCSLL29:CMPQ:BCCP%+4:SBCQ:ROLR:BCSLL31:RTS:.LL29 SBCQ:SEC:ROLR:BCSLL31:RTS:.LL2 LDA#FF:STAR:RTS
  8085.LL38 \BADD(S)A=R+Q(SA)
  8090EORS:BMILL39:LDAQ:CLC:ADCR:RTS:.LL39 LDAR:SEC:SBCQ
  8095BCCP%+4:CLC:RTS:PHA:LDAS:EOR#128:STAS:PLA:EOR#255:ADC#1:RTS
  8100.LL51 \XX12=XX15.XX16
  8105LDX#0:LDY#0:.ll51 LDAXX15:STAQ:LDAXX16,X:JSRFMLTU:STAT:LDAXX15+1:EORXX16+1, X:STAS:LDAXX15+2
  8115STAQ:LDAXX16+2,X:JSRFMLTU:STAQ:LDAT:STAR:LDAXX15+3
  8120EORXX16+3,X:JSRLL38:STAT:LDAXX15+4:STAQ:LDAXX16+4,X:JSRFMLTU:STAQ:LDAT:STAR:LDAXX15+5:EORXX16+5,X
  8130JSRLL38:STAXX12,Y:LDAS:STAXX12+1,Y:INY:INY:TXA:CLC:ADC#6:TAX:CMP#17:BCCll51:RTS

Re: David Horne's 1K Chess on the ZX81 (2001)

#145
post #141

Earlier quoted context omitted.

Yeah alright man, it's everyone else who is wrong. Damn.

Except that my original analogy has a lot of upvotes. But it is common enough to assume that the rest of the world agrees with you, when you think someone is wrong. If, instead of trying the pissing contest, you could actually try to figure out why your "do you see why you're wrong", didn't, in fact, make me think I was wrong, we might get constructive. I think it didn't because it begged the question. Otherwise, pis…

But it is common enough to assume that the rest of the world agrees with you, when you think someone is wrong.

Please, tell me what that's like.

You got so hung up on and defensive about my question that you were blind to my reasoning. I wasn't trying to hurt your feelings — I was offering a genuine explanation. There is no chance of a "constructive" discussion with people like you once they've made themselves a victim.

You haven't attempted to explain why my explanation was poor — which is less than what I gave you — but you're too invested in the lie that you don't understand my post to turn back now! And it's weird as hell to witness. You're a real big man.

Re: David Horne's 1K Chess on the ZX81 (2001)

#146
post #141

Earlier quoted context omitted.

Except that my original analogy has a lot of upvotes. But it is common enough to assume that the rest of the world agrees with you, when you think someone is wrong. If, instead of trying the pissing contest, you could actually try to figure out why your "do you see why you're wrong", didn't, in fact, make me think I was wrong, we might get constructive. I think it didn't because it begged the question. Otherwise, pis…

But it is common enough to assume that the rest of the world agrees with you, when you think someone is wrong. Please, tell me what that's like. You got so hung up on and defensive about my question that you were blind to my reasoning. I wasn't trying to hurt your feelings — I was offering a genuine explanation. There is no chance of a "constructive" discussion with people like you once they've made themselves a vict…

Wow, tell me more about me, please.

I think your post begged the queston. Do you know what I mean by that? I think it assumed the things you wanted it to show. Namely

nor is the greatness of a program measured by its number of lines or memory footprint

That is the point you're trying to argue, but you don't make any attempt to show why that is more like the case of the movie budget, than the running race. You just declare it to be. Now, you made that argument in response to me asking why. But you didn't say why, you just gave the two analogies again, and mixed in the original question with the second.

So we have

"Its like X" "No, its like Y" "Why?" "Because it is like Y"

See why I didn't find your response persuasive?

But by all means, ignore what I'm saying at tell me more about me. That's funny.

[Edit for clarity]

Re: David Horne's 1K Chess on the ZX81 (2001)

#147

Earlier quoted context omitted.

They didn't work like modern interpreters, which basically compile the program into bytecode and then interpret the bytecode. They would do simple very simple parsing of the program, mostly just tokenising it, and then more or less execute each Basic statement directly. (Sinclair Basic's wacky keyword-at-a-time entry system meant they didn't need to ship a tokeniser.) So: 10 LET I = 10 20 LET I = I + 1 30 GOTO 10 The…

"I've no idea how Sinclair Basic stored them, but BBC Basic used a hash table that was immediately after the end of your program." I expected that Sinclair Basic would have a rule that variable names have one significant character, and reserved space for 26 integers A% through Z%, 26 strings A$ through Z$, and forget about floating point, but reading http://www.worldofspectrum.org/ZX81BasicProgramming/chap06.h... , t…

Everything you never wanted to know about ZX81 Basic's memory layout!

http://www.worldofspectrum.org/ZX81BasicProgramming/chap27.h...

...wow. The framebuffer is between the program and the variables? And as the program changes size, and the screen changes size, it relocates everything above there? No wonder editing lines in a big program is so slow...

Also, that mention of the calculator stack? That's used by an embedded Forth-like language used to do floating point operations; which is why Sinclair Basic's trig functions are so appalling.

Re: David Horne's 1K Chess on the ZX81 (2001)

#148
post #89

Earlier quoted context omitted.

There are 4.7 bits per character for Latin text, which means the comment would have 853 bytes of uncompressed information. Estimates of information density for English are as low as 1.5 bits per character, giving 272 bytes in that comment. The information density in machine code isn't 1 bits per bit though, because of the distribution of which opcodes are used, so the 672 would also drop. So I think the analogy is a…

> Estimates of information density for English are as low as 1.5 bits per character Can you expand on that?

I'm not an information scientist, so this maybe a lay understanding, but as I understand it there is a limit to how much you could theoretically compress any piece of content without losing information. So take that 4.7 bits per character: well, not every letter is equally likely, so we could construct an encoding which takes frequency into account, but then not every word is equally likely, so we could use that information to make a tighter encoding, and so on. At some point we would reach a theoretical minimum.

At that limit, the size of the compressed data has one bit per bit of information.

So, scaling back up, the estimate is (and it has to be an estimate, I guess, since we can't construct the actual theoretically smallest encoding) 1.5 bits of information per character.

I searched for this value, and didn't spend long figuring out if it was well calculated, so take it with a big googly pinch of salt.

Re: David Horne's 1K Chess on the ZX81 (2001)

#149
post #47

I'm not sure why the size of a program has any serious bearing on it's greatness. Sure it's an incredible feat of engineering, but shouldn't the "greatest program ever written" be primarily judged by what it allows us to do, not need to do, to build, or what insights it provides? For example, certainly the first widely used assembler was a "greater" program than any chess game, not only because it stopped us from hav…

I agree. I couldn't care less what he had to do in order to fit his not really usable (from a chess enthusiasts perspective) chess implementation in N kb. Apparently N kb is not enough for a good chess program.

However, 1024 bytes was, at the time, all the RAM available, in a computer that was the only one many people could afford. For some, like me, a computer was in fact a very good way to find a chess opponent.

Therefore, for a chess enthusiast of 1981-1982, this program was groundbreaking. You could actually get a computer to play against you.

(Personally, I did not have ZX81 but I got ZX Spectrum. I had to mow a lot of lawn and dig some graves at the local cemetery to get the money for a 16K Speccie.)

Re: David Horne's 1K Chess on the ZX81 (2001)

#150
post #146

Earlier quoted context omitted.

But it is common enough to assume that the rest of the world agrees with you, when you think someone is wrong. Please, tell me what that's like. You got so hung up on and defensive about my question that you were blind to my reasoning. I wasn't trying to hurt your feelings — I was offering a genuine explanation. There is no chance of a "constructive" discussion with people like you once they've made themselves a vict…

Wow, tell me more about me, please. I think your post begged the queston. Do you know what I mean by that? I think it assumed the things you wanted it to show. Namely nor is the greatness of a program measured by its number of lines or memory footprint That is the point you're trying to argue, but you don't make any attempt to show why that is more like the case of the movie budget, than the running race. You just de…

Please stop, both of you.
Post reply on HN