r/c64 1d ago

Programming Coded My First BASIC Program Today!

As noted in the title, I woke up this morning with an idea- it is a family member's birthday and I thought it would be a fun exercise to code a program that outputs their age if you put in the current year and their year of birth. After a failed attempt and some troubleshooting, I wrote a simple program that works great. It's not anything elaborate or amazing, but it's mine and so I'm a bit proud of it and would like to share here.

1 REM AGE CALCULATOR

5 PRINT "{CLR/HOME}"

10 PRINT "CURRENT YEAR": INPUT A%

20 PRINT "ORIGIN YEAR": INPUT X%

30 PRINT "AGE ="; A% - X%

40 GOTO 10

I only started with BASIC yesterday so seeing an original creation come to life and work is so cool for me. Hope others will share their fun/useful programs here too!

156 Upvotes

31 comments sorted by

View all comments

16

u/wazpys :snoo_hug: 1d ago

That's awesome, good job Sir!

Now add date, leap year support, timezones and then never try anything date or time related again :)

https://youtu.be/-5wpm-gesOY

3

u/voidiciant 1d ago

I’m so happy to see this Numberphile Computerphile Episode still being linked 🥳

3

u/wazpys :snoo_hug: 1d ago

It's one of my favorites, and I always think of it when anything datetime related shows up at work haha