神刀安全网

Ask HN: Refactoring a BASIC Blackjack Game from the 70s

Here is an old Black Jack game listing from waaay back in the 70s, According to 101 BASIC computer Games it originated from DEC – author unknown.

http://www.vintage-basic.net/bcg/blackjack.bas

Anyway, reasonably complex, supports up to seven players has insurance, splits and double downs.

If you ever wanted to get a taste of the weirdness of BASIC coding this is a good 322 line (commented) example:

In defense of the code: – part is that there was no multi-line IF conditionals so you had to get creative – micros being so memory limited usually had a 2 character limit on variable names – there was a lot of twisted logic sometimes to get a game crammed into a small memory footprint

I’m gonna re-factor it into PHP, but thought it was a good example to discuss here: BASIC, refactoring such code, etc.

Source site with more BASIC game listings – http://www.vintage-basic.net/games.html

What do you think?

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Ask HN: Refactoring a BASIC Blackjack Game from the 70s

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址