[HN Gopher] A constructive look at the Atari 2600 BASIC cartridge ___________________________________________________________________ A constructive look at the Atari 2600 BASIC cartridge Author : reaperducer Score : 26 points Date : 2021-01-06 19:14 UTC (3 hours ago) (HTM) web link (boston.conman.org) (TXT) w3m dump (boston.conman.org) | mikestew wrote: | Okay, so we have the common trope of "Atari 2600 BASIC was | horrible" (and it was), and now "meh, it wasn't _that_ bad ". But | it seems the only people that actually used the cartridge for | more than five minutes are the two groups writing those things. | What I want is, "How I Used the Atari 2600 BASIC Cartridge to Do | Something Useful". 64 bytes ought to be enough for anyone, | amirite? | | Seriously, did anyone who bought one do more than plug it in and | become very disappointed? | wazoox wrote: | Misses "2015" in the title I guess. | fortran77 wrote: | I almost forgot--the IF statement is an expression! You can do | the following: A - IF B = 15 THEN 40 ELSE 99 | and A will be 40 if B is 15, otherwise A will be 99. There aren't | many languages I've used that have allowed this | | I need to introduce this man to the wonderful world of Haskell, | Erlang, and other Functional Programming Languages. | sedatk wrote: | That's very confusing as other BASIC dialects had used the same | syntax in lieu of GOTO. `IF B = 15 THEN 40 ELSE 99` would be | equivalent to `IF B = 15 THEN GOTO 40 ELSE GOTO 99`. | Mountain_Skies wrote: | Why is this desirable? It saves maybe half a dozen keystrokes | in exchange for less readable and thus less maintainable code. | jandrese wrote: | On the 2600 if it saved you a byte or two it was a big win. | Remember your program had to fit in _64 bytes_ of memory. Not | kilobytes, single bytes. And your numbers are BCD encoded, so | they 're extra inefficient. | jaymzcampbell wrote: | Python also lets you do this, definitley a nice bit of sugar | | ``` In [2]: b = 15; In [3]: a = 40 if b == 15 else 99; In [4]: | a; Out[4]: 40; ``` | mattw2121 wrote: | and PHP | | ``` $a = $b == 15 ? 40 : 99; ``` | KSS42 wrote: | Verilog has a conditional operator ?: | | condition ? value_if_true : value_if_false | | It is used quite extensively in ASIC design. | bluedino wrote: | As does C, Ruby... | kgwxd wrote: | Clojure: (def a (if (= b 15) 40 99)) | | Also: (def a (cond (= b 15) 40 (= b 20) 50 :else 99)) | 0x7755XP wrote: | It's identical to the ternary operator (for most c like | programming languages) ___________________________________________________________________ (page generated 2021-01-06 23:01 UTC)