HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Fixing a bug in "Airwolf" code from 1984

Behind the Screens · Youtube · 255 HN points · 0 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Behind the Screens's video "Fixing a bug in "Airwolf" code from 1984".
Youtube Summary
Back in 1984 the Apple ][ was an exciting computer. So exciting that it played a key role in the Airwolf episode "Moffett's Ghost". Unfortunately, the code, like Airwolf itself, is buggy. Luckily we can fix the bug... 30 years on.

Useful links:
LinApple Apple ][ emulator: http://linapple.sourceforge.net/
Source code used in Airwolf: https://gist.github.com/jgrahamc/926a7854c2668f20edb58fe62ac3f99f
Tumblr entry: https://moviecode.tumblr.com/post/72844286142/in-episode-3-of-series-2-of-airwolf-computer
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Oct 15, 2019 · 1 points, 0 comments · submitted by jgrahamc
May 11, 2017 · 250 points, 53 comments · submitted by wslh
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...

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

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/
Johnny555
Even if it were 0.0 to 1.0 inclusive there'd still be a bug in the code since there's a very slim chance of getting a 1.000000 from the RNG, so in that buggy code, 'F' would still almost never be selected.

For that reason, a floating point random number from 0 to 1.0000000 inclusive would be hard to work with.

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.
fapjacks
I hope this message reaches you before you take the plunge...... I would recommend not watching Airwolf as an adult. Let it live in the "wondrous memory" part of your brain forever.
botverse
This a delight. I've been stumbling upon them since 2014, more examples here:

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

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

exlurker
R.I.P. EVS 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 Based on This Tumblr: 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). (Why "whiz" and not "wiz?")
brightball
Hands down, greatest TV show ever made. You're free to disagree, but your opinion is wrong.
XJOKOLAT
My heart agrees with you ... it is.

But I watched a couple of episodes a few weeks ago (yikes!)

bartread
I did a similar thing a while back and, although it was one of my favourite shows as a kid, I have to conclude that re-watching it was a mistake. Same with Knightrider.
dvtv75
I've been re-watching Knight Rider on-and-off for a while now, and it's actually fairly good. I wouldn't compare it directly to anything modern, as long as I accept it for what it is - a 1980s show.
bartread
Noooooo - you're tempting me. :)
bdcravens
This is so true - Knightrider was my favorite as a child, and I need to leave my memories of it with 7 year old me.
brightball
The trick is to skip season 1.

Season 2 and 3 was where the real meat of the show was found.

Fun Fact: My wife wouldn't let me name our son Stringfellow

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.

kkylin
Oh my. I really loved Airwolf as a kid. I did not need to see this.
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
jgrahamc
Huh. Cool to see this get some space on the HN front page. I created the Tumblr 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.

TeMPOraL
Do Person of Interest please :). They actually used Shellshock on-screen as an exploit quite soon after it was in the news, and also AFAIR featured Stuxnet dumps.

Revolution had some Lisp code in the first season[0].

[0] - https://dl.dropboxusercontent.com/u/216352/lisp-in-Revolutio...

jgrahamc
Please submit stuff you see to the Tumblr so I can keep track of it all.
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.
wang_li
That came from Nibble Magazine.
jgrahamc
Yes. I'm going to do that at some point.
markh1967
They really should have used the code that controlled the ghosts in Pac-Man.
trentnelson
Arrival has an R Jupyter Notebook featured about half way through when they're doing analysis.

And 24 had Chloe walking over to a terminal and doing `svn unlock xyz` once.

mozumder
I bet you'll find a trove of bugs in "Whiz Kids" and "Automan"
jgrahamc
Oh man, I loved Whiz Kids when it was on TV. I'm not specifically looking for bugs or 8 bit stuff just really spelunking into where the code came from. The Westworld one is very interesting because it's 1973 and Westworld was the first film with computer graphics in it... I finally figured out what's being shown.
lmm
Not a movie but there's a wonderful source listing in Lost Universe (I think) where the C code starts with some macros that use setjmp/longjmp to implement gosub/return. Will try to find specific episode/timestamp when I get home.
agumonkey
I had a bunch of screenshots from a movie, I'll get back to you as soon as I found them. The VBA code is quite funny.
jgrahamc
Nice. Please submit them to my Tumblr!
botverse
Can't wait for the Knight Rider one
noir_lord
One of the episodes of SG1 had the source code of the Replicators on screen, iirc it was the HTML output for the Bank of Canada.

I just googled it and found http://thedailywtf.com/articles/Stargate-Code-of-the-Replica... so that might be a fun one to do a deep dive on.

jgrahamc
Yes, thanks. I have that one in the queue to do a video on. But thanks for that link as I'm trying in the text beneath the videos to credit people who discover these things and I'll add that.
noir_lord
Cool!, I love the site btw, I could get lost in that stuff for hours :).
LordKano
I went out for beers with those guys one time. They were all pretty cool individuals.

It's funny because when I arrived at the restaurant, they were easy to spot. It was the table full of pony tails and neckbeards. (Not joking)

jgrahamc
Which guys?
LordKano
The guys from thedailywtf.com

The only one I remember by name is Remy.

Kiro
You were replying to a comment about moviecode.tumblr though. Just FYI.
PhasmaFelis
The root comment was about moviecode, but its immediate child was about dailywtf.
Kiro
The "I love the site btw" referred to moviecode though since it was a reply to jgrahamc, hence his question.
dottrap
Here's another one if you don't already have it. Numb3rs shows Objective-C/UIKit code (UITableViewCell and NSArray *crayon)

https://mtgap.wordpress.com/2009/08/14/objective-c-reference...

May 10, 2017 · 4 points, 0 comments · submitted by jgrahamc
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.