
Fixing a bug in “Airwolf” code from 1984 [video] - wslh
https://www.youtube.com/watch?v=k1K-CRi_yZ0
======
jgrahamc
Huh. Cool to see this get some space on the HN front page. I created the
Tumblr [https://moviecode.tumblr.com/](https://moviecode.tumblr.com/) a few
years ago and I've started this channel to go a little deeper into some of the
examples. Hope people like it.

Next up: two episodes of Knight Rider, Westworld (1973) and Swordfish.

~~~
aswanson
Did you take a look at the 6502 assembler in "The Terminator". Maybe you can
find the bug that stopped AHnold from killing Sarah Connor.

~~~
markh1967
They really should have used the code that controlled the ghosts in Pac-Man.

------
ojosilva
If anyone, like me, is wondering if the bug solution is correct, here's the
original documentation for the RND() function in Applesoft BASIC language
(page 102):

[https://mirrors.apple2.org.za/Apple%20II%20Documentation%20P...](https://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Software/Languages/Applesoft%20BASIC/Manuals/Applesoft%20II%20BASIC%20Programming%20Reference%20Manual.pdf)

Which says:

    
    
        RND(aexpr)
        Returns a random real number greater than or equal to 0 and less than 1.
    

Which is pretty much the standard for a random function in many other computer
languages through history, ie. Python's random.random(), JS Math.random(), ...
There are other, more creative versions of the function, like Perl's and
Ruby's rand(max), which differ slightly by allowing the user to set the max
number.

But this other reference link, which presumably takes its information from the
back of another book could have led the Airwolf programmer to make the
mistake:

[http://www.landsnail.com/a2ref.htm](http://www.landsnail.com/a2ref.htm)

It says the generated number is _between 0 and 1_ , without mention to 1 being
exclusive. I believe this a common confusion when it comes to RND() usage.

~~~
smitherfield
Another way to fix the bug would've been

    
    
      INT(RND(1) * 15 + .5)
    

which is equivalent to rounding to the nearest integer* instead of truncating.

*If positive, which RND's return value must be.

~~~
rzzzt
The labyrinth-printing example for the C64 also uses this:
[https://10print.org/](https://10print.org/)

------
sideproject
Airwolf + Nightrider filled my young mind in the 80s. Ahh, how I used to love
watching them!

~~~
rzzzt
Street Hawk, anyone?

~~~
richharms
Absolutely! As a kid that rode dirt bikes all the time, and loved technology,
I was totally into it. That and Knight Rider spurred a lot of ideas when I was
young, and I was excited when I came across a set of Street Hawk DVDs a few
years back. Brought back great memories.

~~~
rzzzt
I liked both series, but the music of Street Hawk feels a lot better. Knight
Rider has a very dark and heavy mood.

------
botverse
This a delight. I've been stumbling upon them since 2014, more examples here:

[https://moviecode.tumblr.com](https://moviecode.tumblr.com)

------
louprado
This is a gratuitous digression, but the _retreating blade stall_ is a key
reason we don't have supersonic helicopters.

The Helicopter Speed Limit - Helicopter Physics Series - #7 - Smarter Every
Day 51 -- starts at 2m46s
[https://www.youtube.com/watch?v=_pbdwueqGp4](https://www.youtube.com/watch?v=_pbdwueqGp4)

~~~
DoofusOfDeath
That's a neat video.

I was surprised to learn that Chinooks are faster than sportier-looking
helicopters because of that factor.

------
DINKDINK
Slightly off topic but this may be the only time that it's semi relevant to
get this onto HN:

Edwin Van Santen - Airwolf (Mix) Commodore 64
[https://www.youtube.com/watch?v=15oujjzU1lM](https://www.youtube.com/watch?v=15oujjzU1lM)

~~~
exlurker
R.I.P. EVS [https://8bitlegends.com/edwin-van-
santen](https://8bitlegends.com/edwin-van-santen)

------
joeblau
I just saw the name and started humming the theme song. This show and game
made me want to become a helicopter pilot.

~~~
cptskippy
Did you become a helicopter pilot?

------
pieter1976
The whole channel seems interesting
[https://www.youtube.com/c/BehindtheScreens](https://www.youtube.com/c/BehindtheScreens)
Based on This Tumblr:
[https://moviecode.tumblr.com/](https://moviecode.tumblr.com/)

------
asciimo
There's got to be plenty of code to enjoy in Whiz Kids
([https://www.youtube.com/watch?v=GDdVbOcUlTo](https://www.youtube.com/watch?v=GDdVbOcUlTo)).
(Why "whiz" and not "wiz?")

------
brightball
Hands down, greatest TV show ever made. You're free to disagree, but your
opinion is wrong.

~~~
gooseus
We need more Jan Michael Vincents!

Though if you actually follow @AirWolf4Life for any length of time you may
disagree with that previous statement.

~~~
JustSomeNobody
Anyone curious about this, don't use your work computer.

------
duke360
they hit one of the two major problems in informatics... :D the number 3 in
particular :D

