News for hackers. Stuff that matters.
Re:Ask HN: What is your first piece of code? by madhouse on Friday December 16, 2011 @05:51AM (#3360313)
A jumping man, in C+4 BASIC: clear screen, draw an ASCII stick figure, for loop to wait, clear screen, draw stick figure in different position, for loop to wait, goto 10.

I still know it by heart, though it was written more than two decades ago.

Re:Ask HN: What is your first piece of code? by kalerzee on Friday December 16, 2011 @05:56AM (#3360328)
So complex.
Re:Ask HN: What is your first piece of code? by kingofspain on Friday December 16, 2011 @05:59AM (#3360333)
I can't remember, but it would be whatever is the first listing in this: http://www.worldofspectrum.org/ZX81BasicProgramming/frontcvr...
Re:Ask HN: What is your first piece of code? by dubya on Friday December 16, 2011 @08:42AM (#3360638)
Maybe not the first, but I remember typing the line

## REM TYPE "IS A FLASHY PERSON" IN INVERSE VIDEO

from a listing in the little manual that came with my Atari 800XL, before I new what REM meant.

Re:Ask HN: What is your first piece of code? by kschua on Friday December 16, 2011 @07:19AM (#3360486)
INT 20H

Got me started on programming way back in the mid 80s. Once I knew how to make a program exit, I was more confident of writing more code

Re:Ask HN: What is your first piece of code? by bartonfink on Friday December 16, 2011 @10:18AM (#3360915)
A "password" program in basic that sat in a loop checking input unless you typed in a hardcoded string. Not exactly production quality.
Re:Ask HN: What is your first piece of code? by j_col on Friday December 16, 2011 @05:44AM (#3360300)
Making a sprite of a balloon move across the screen of my Commodore 64 in BASIC (the code came in the manual with the machine).
Re:Ask HN: What is your first piece of code? by Natsu on Friday December 16, 2011 @07:19AM (#3360484)
It was some form of:

  10 PRINT HELLO
  20 GOTO 10
on an Apple ][ GS when I was ~6 years old.
Re:Ask HN: What is your first piece of code? by chris_dcosta on Friday December 16, 2011 @07:42AM (#3360530)
Something similar on a Commodore PET at school. Aged 11ish.
Re:Ask HN: What is your first piece of code? by mikegirouard on Friday December 16, 2011 @04:14PM (#3362357)
Ditto, except mine was in QBasic on a DOS box.
Re:Ask HN: What is your first piece of code? by dholowiski on Friday December 16, 2011 @09:48AM (#3360823)
Same, on a TRS-80 when I was about 14.
Re:Ask HN: What is your first piece of code? by bromagosa on Friday December 16, 2011 @11:50AM (#3361189)
Same, on an MSX when I was 8 :P
Re:Ask HN: What is your first piece of code? by mdoyle on Friday December 16, 2011 @08:19AM (#3360598)
On the ZX Spectrum:

10 PRINT <something>; 20 GOTO 10

I was hooked from that point on. Brings back memories.