Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.sinclair > #17 > unrolled thread

Re: Blackjack for the ZX80 (mostly) completed

Started byPedro Timóteo <pedro@dehumanizer.com>
First post2011-03-02 22:51 +0000
Last post2011-03-04 02:30 +0100
Articles 8 — 5 participants

Back to article view | Back to comp.sys.sinclair

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Blackjack for the ZX80 (mostly) completed Pedro Timóteo <pedro@dehumanizer.com> - 2011-03-02 22:51 +0000
    Re: Blackjack for the ZX80 (mostly) completed "N.N. Thayer" <nnthayer1@gmail.com> - 2011-03-02 18:59 -0800
      Re: Blackjack for the ZX80 (mostly) completed spike1@freenet.co.uk - 2011-03-03 03:20 +0000
        Re: Blackjack for the ZX80 (mostly) completed "N.N. Thayer" <nnthayer1@gmail.com> - 2011-03-03 03:06 -0800
          Re: Blackjack for the ZX80 (mostly) completed gus <gdeldago@gmail.com> - 2011-03-03 05:42 -0800
          Re: Blackjack for the ZX80 (mostly) completed gus <gdeldago@gmail.com> - 2011-03-08 13:58 -0800
      Re: Blackjack for the ZX80 (mostly) completed Pedro Timóteo <pedro@dehumanizer.com> - 2011-03-03 14:30 +0000
        Re: Blackjack for the ZX80 (mostly) completed "dott.Piergiorgio" <dott.PiergiorgioNIHON@KAIGUN.fastwebnet.it> - 2011-03-04 02:30 +0100

#17 — Re: Blackjack for the ZX80 (mostly) completed

FromPedro Timóteo <pedro@dehumanizer.com>
Date2011-03-02 22:51 +0000
SubjectRe: Blackjack for the ZX80 (mostly) completed
Message-ID<ikmhkv$olh$1@speranza.aioe.org>
On 02-03-2011 00:09, N.N. Thayer wrote:
> - I've seen instances where the computer will hit and receive the
> exact same card a suspicious number of times in a row.  It doesn't
> happen very often, but it does happen, and I guess it's just a
> consequence of how the ZX80 generates random numbers, so there may not
> be much that can be done about that.

I didn't look at the code, but what about asking for a keypress after 
the computer hits, and then doing a RANDOMISE afterwards? It'll reset 
the random number generator each time. It makes the program less user 
friendly, though.

[toc] | [next] | [standalone]


#18

From"N.N. Thayer" <nnthayer1@gmail.com>
Date2011-03-02 18:59 -0800
Message-ID<56c28b4f-5ec0-4fc6-8213-e0656baef230@p16g2000vbo.googlegroups.com>
In reply to#17
On Mar 2, 4:51 pm, Pedro Timóteo <pe...@dehumanizer.com> wrote:
> On 02-03-2011 00:09, N.N. Thayer wrote:
>
> > - I've seen instances where the computer will hit and receive the
> > exact same card a suspicious number of times in a row.  It doesn't
> > happen very often, but it does happen, and I guess it's just a
> > consequence of how the ZX80 generates random numbers, so there may not
> > be much that can be done about that.
>
> I didn't look at the code, but what about asking for a keypress after
> the computer hits, and then doing a RANDOMISE afterwards? It'll reset
> the random number generator each time. It makes the program less user
> friendly, though.

It makes technical sense, but yeah, it would kinda ruin the automation
of the computer playing its own hand.  Still, I'm curious about why
I'm seeing the behavior at all.  The majority of the time, the RNG
honestly does work well enough for decent blackjack.  But every so
often I see the computer hit "1,1,1,1".  Maybe it has something to do
with the FRAMES variable, I dunno.

Overall it's less important than the 11-vs-1 ace issue, though.  I'm a
little surprised that wasn't addressed in the original author's code.

[toc] | [prev] | [next] | [standalone]


#19

Fromspike1@freenet.co.uk
Date2011-03-03 03:20 +0000
Message-ID<v0e348-ns4.ln1@librarian.sky.com>
In reply to#18
And verily, didst N.N. Thayer <nnthayer1@gmail.com> hastily babble thusly:
> Overall it's less important than the 11-vs-1 ace issue, though.  I'm a
> little surprised that wasn't addressed in the original author's code.

Didn't you mention the original author being Tim Hartnell?
Not meaning to dis those long departed, his typeins were all a bit on the
crap side from my experience... Dunno why he gained such respect as a
programmer back in the day.

Possibly cos he was quite prolific in the early days.
-- 
|   spike1@freenet.co.uk   |   Windows95 (noun): 32 bit extensions and a    |
|                          | graphical shell for a 16 bit patch to an 8 bit |
|   Andrew Halliwell BSc   | operating system originally  coded for a 4 bit |
|            in            |microprocessor, written by a 2 bit company, that|
|     Computer Science     |        can't stand 1 bit of competition.       |

[toc] | [prev] | [next] | [standalone]


#20

From"N.N. Thayer" <nnthayer1@gmail.com>
Date2011-03-03 03:06 -0800
Message-ID<f86f6895-1fb2-44fa-a1dc-981ebe1ee2ad@k10g2000prh.googlegroups.com>
In reply to#19
On Mar 2, 9:20 pm, spi...@freenet.co.uk wrote:
> And verily, didst N.N. Thayer <nnthay...@gmail.com> hastily babble thusly:
>
> > Overall it's less important than the 11-vs-1 ace issue, though.  I'm a
> > little surprised that wasn't addressed in the original author's code.
>
> Didn't you mention the original author being Tim Hartnell?
> Not meaning to dis those long departed, his typeins were all a bit on the
> crap side from my experience... Dunno why he gained such respect as a
> programmer back in the day.
>
> Possibly cos he was quite prolific in the early days.
> --
> |   spi...@freenet.co.uk   |   Windows95 (noun): 32 bit extensions and a    |
> |                          | graphical shell for a 16 bit patch to an 8 bit |
> |   Andrew Halliwell BSc   | operating system originally  coded for a 4 bit |
> |            in            |microprocessor, written by a 2 bit company, that|
> |     Computer Science     |        can't stand 1 bit of competition.       |

Looking at some of Hartnell's other programs, it seems like it's
better to regard them as instructional tools rather than polished
products - you'd use them to learn the fundamentals of BASIC
programming, and then either improve upon the existing code or go off
and create your own programs.  I guess this would have been a
reasonable approach in the days before it was realized that the
majority of home computer users actually wouldn't want to learn
programming.

[toc] | [prev] | [next] | [standalone]


#21

Fromgus <gdeldago@gmail.com>
Date2011-03-03 05:42 -0800
Message-ID<750b928c-538b-4213-9519-1a62eb95bf24@f36g2000pri.googlegroups.com>
In reply to#20
On Mar 3, 8:06 am, "N.N. Thayer" <nnthay...@gmail.com> wrote:
> On Mar 2, 9:20 pm, spi...@freenet.co.uk wrote:
>
>
>
>
>
>
>
> > And verily, didst N.N. Thayer <nnthay...@gmail.com> hastily babble thusly:
>
> > > Overall it's less important than the 11-vs-1 ace issue, though.  I'm a
> > > little surprised that wasn't addressed in the original author's code.
>
> > Didn't you mention the original author being Tim Hartnell?
> > Not meaning to dis those long departed, his typeins were all a bit on the
> > crap side from my experience... Dunno why he gained such respect as a
> > programmer back in the day.
>
> > Possibly cos he was quite prolific in the early days.
> > --
> > |   spi...@freenet.co.uk   |   Windows95 (noun): 32 bit extensions and a    |
> > |                          | graphical shell for a 16 bit patch to an 8 bit |
> > |   Andrew Halliwell BSc   | operating system originally  coded for a 4 bit |
> > |            in            |microprocessor, written by a 2 bit company, that|
> > |     Computer Science     |        can't stand 1 bit of competition.       |
>
> Looking at some of Hartnell's other programs, it seems like it's
> better to regard them as instructional tools rather than polished
> products - you'd use them to learn the fundamentals of BASIC
> programming, and then either improve upon the existing code or go off
> and create your own programs.  I guess this would have been a
> reasonable approach in the days before it was realized that the
> majority of home computer users actually wouldn't want to learn
> programming.


Well I agree with Thayer,
I respect the work of Hartnell's, I think that in his case you can't
separate the Writer and the Programmer.
I mean, Tim gives you a baseline in basic and some ideas to improve
the "sample" programs. In this article he explains the limitations of
his implementation and suggest some improvements too.

Gus

[toc] | [prev] | [next] | [standalone]


#49

Fromgus <gdeldago@gmail.com>
Date2011-03-08 13:58 -0800
Message-ID<c4ddd42c-8ad7-4617-99e8-bbcd3ed4263e@18g2000prd.googlegroups.com>
In reply to#20
On 3 mar, 08:06, "N.N. Thayer" <nnthay...@gmail.com> wrote:
> On Mar 2, 9:20 pm, spi...@freenet.co.uk wrote:
>
>
>
> > And verily, didst N.N. Thayer <nnthay...@gmail.com> hastily babble thusly:
>
> > > Overall it's less important than the 11-vs-1 ace issue, though.  I'm a
> > > little surprised that wasn't addressed in the original author's code.
>
> > Didn't you mention the original author being Tim Hartnell?
> > Not meaning to dis those long departed, his typeins were all a bit on the
> > crap side from my experience... Dunno why he gained such respect as a
> > programmer back in the day.
>
> > Possibly cos he was quite prolific in the early days.
> > --
> > |   spi...@freenet.co.uk   |   Windows95 (noun): 32 bit extensions and a    |
> > |                          | graphical shell for a 16 bit patch to an 8 bit |
> > |   Andrew Halliwell BSc   | operating system originally  coded for a 4 bit |
> > |            in            |microprocessor, written by a 2 bit company, that|
> > |     Computer Science     |        can't stand 1 bit of competition.       |
>
> Looking at some of Hartnell's other programs, it seems like it's
> better to regard them as instructional tools rather than polished
> products - you'd use them to learn the fundamentals of BASIC
> programming, and then either improve upon the existing code or go off
> and create your own programs.  I guess this would have been a
> reasonable approach in the days before it was realized that the
> majority of home computer users actually wouldn't want to learn
> programming.

I checked some Tim Hartnell book`s and found that on his "49 Explosive
Games for the ZX81" was published a version of Black Jack for the
ZX80, in fact the book has a section called "Rip-Roaring games for the
ZX80".
Well I think you likes to know that. I will check the source code...
Cheers,
Gus

[toc] | [prev] | [next] | [standalone]


#22

FromPedro Timóteo <pedro@dehumanizer.com>
Date2011-03-03 14:30 +0000
Message-ID<iko8lr$9ri$1@speranza.aioe.org>
In reply to#18
On 03-03-2011 02:59, N.N. Thayer wrote:
> On Mar 2, 4:51 pm, Pedro Timóteo<pe...@dehumanizer.com>  wrote:
>> I didn't look at the code, but what about asking for a keypress after
>> the computer hits, and then doing a RANDOMISE afterwards? It'll reset
>> the random number generator each time. It makes the program less user
>> friendly, though.
>
> It makes technical sense, but yeah, it would kinda ruin the automation
> of the computer playing its own hand.

OK, then you can go for a lesser version: RANDOMISE after the player 
makes any decision. Since the computer is already waiting for the player 
anyway (and thus generating a "random" number of seconds since the 
computer was turned on, each time)...

[toc] | [prev] | [next] | [standalone]


#30

From"dott.Piergiorgio" <dott.PiergiorgioNIHON@KAIGUN.fastwebnet.it>
Date2011-03-04 02:30 +0100
Message-ID<_gXbp.3304$2w1.2411@tornado.fastwebnet.it>
In reply to#22
Il 03/03/2011 15:30, Pedro Timóteo ha scritto:

> OK, then you can go for a lesser version: RANDOMISE after the player
> makes any decision. Since the computer is already waiting for the player
> anyway (and thus generating a "random" number of seconds since the
> computer was turned on, each time)...

the issue of the non-deterministic random seed can be eased in this 
manner for an interactive program, but for a non-interactive program I 
don't see an easy solution (well, I'm always interested in montecarlo 
simulations, being mainly an military & Naval historian ;) )

Best regards from Italy,
dott. Piergiorgio.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.sinclair


csiph-web