6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 10, 2024 9:23 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sun Nov 05, 2017 6:40 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Nearby, LBSC's introduction set me thinking: for anyone growing up since the era of PCs, and even more so for people growing up since the era of GPUs, their first experience of computing is intensively graphical and interactive. When computers can present a real-time simulation of a 3D world with hundreds of independent intelligent agents interacting, it might be difficult to get excited about writing a program to convert Fahrenheit to Celsius. There's a huge gulf between simple arithmetic and everyday applications.

So, what might we suggest as programs to write - in Basic, or in assembly language, or Python, or JavaScript, or any other easily accessible language - which might just about capture the imagination, provide a sense of acheivement, and lead on to a succession of ever more sophisticated programs?

How to write World of Warcraft? Start by writing Hangman!

Here are some ideas from the past:
- hangman game
- guess a number game
- bulls and cows (mastermind) game
- noughts and crosses (tic-tac-toe)
- lunar lander game
- snake
- tetris

(See for example 101 Basic Computer Games which is what got Steve Wozniak started, and the easy6502 tutorial.)

(It's common to start with numbers: prime numbers for example. But I think that has great appeal to the few people who feel excited about arithmetic, and negative appeal to very many others.)


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 05, 2017 4:38 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1746
Location: Sacramento, CA
one more game to add.... Cannon fire. I did that one in school in 1981 on an Apple ][ using BASIC. My math teacher helped with the physics calculations. I had variable positions, heights, mountains, and wind. The player could only adjust the angle of their cannon. It also had 2 player or 1 player mode, where the computer would start with a random angle and would zero in on you. You had to work skillfully to beat it.

It may be helpful to provide any math formulas needed for these games, so as not to discourage someone who might otherwise struggle with it.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 06, 2017 2:32 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
One idea I had a long time ago was to create a BASIC interpreter in JavaScript. A modern computer with a modern browser could probably run it pretty quick (or, quick enough).

But then again, doesn't have to be in a browser. The idea of Node.js running:

Code:
10 PRINT "HELLO WORLD!"
20 GOTO 10


would be pretty awesome.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 07, 2017 12:19 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Early on, all I did was write games. I typed them in from books/magazines, or I wrote them from scratch.

I always advocate young coders to write games. The reason is that most young developers honestly don't have other "problems to solve".

The entire point of working with computers is to solve problems. I never got much in to micro controllers because at home or professionally I never had any hardware to control. I did some "blink the LED" things on my KIM-1, but, honestly, that only goes so far.

And, you know, as a teenager, I didn't do a lot of check book balancing, or accounts payable. So, that was right out.

However, games have just all sorts of problems to solve. My computer teacher in high school has a Sub Hunt game, a 3-D tic tac toe game, and a pretty good Blackjack game using the extended PET character set.

Of course, today, the hard part (to me it's the hard part) is that they're very graphic rich, and you may just get trapped trying to get assets for the characters or tanks or starships. We just use E for Enterprise and such.

I remember a very early struggle at trying to replicate Space Invaders. I wrote one version in assembler. And I got the "move the base" code written, but it just didn't work. Hit the right arrow, and the base was on the right side. Hit the left, and it was on the left. I just didn't understand what was going on.

Then I realized, that my code was fine, but it just ran so fast you couldn't see the base move. "Oh!"

I tried again, this time in BASIC. And the hard problem I had to solve was how to identify the aliens that I hit. I had a horrible/clever solution. Simply, I put a different ASCII code in each alien on the screen. When the missile "hit something", I would simply "look around" to find the code, and that identified the alien to explode. It looked terrible on the screen. But that's what you do when you're making a first crack at something with which you have no experience as a junior in high school.

As above was as example, writing games gives early developers a very healthy Edison experience. "I know thousands of things that don't work!"


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 07, 2017 4:33 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
I think you're on to something there, with the motivation: to write a program, you need to care a bit about the problem you're solving.

Another possibility, other than games, is art. For visual art, there's something which starts as Etch-a-Sketch and works its way up to a pixel paint program. For words, there might be some mileage in story telling or poetry generation. Remember the joy of having the computer do something, perhaps especially something unexpected. In fact, printing "hello world" or "I am the greatest" could be thought of as the smallest possible story, or poem - what's needed is a way to step beyond that.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 07, 2017 3:50 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
BigEd wrote:
I think you're on to something there, with the motivation: to write a program, you need to care a bit about the problem you're solving.

Another possibility, other than games, is art. For visual art, there's something which starts as Etch-a-Sketch and works its way up to a pixel paint program. For words, there might be some mileage in story telling or poetry generation. Remember the joy of having the computer do something, perhaps especially something unexpected. In fact, printing "hello world" or "I am the greatest" could be thought of as the smallest possible story, or poem - what's needed is a way to step beyond that.

Not everyone like art and poems :).

Back when we had our IMSAI 8080, we were showing it to one of the guys (Gabe).
Code:
10 PRINT "GABE IS A GEEK"
20 GOTO 10

And hilarity ensued. HAHAHAHA

Until Gabe turned the machine off.

You don't turn the IMSAI off. You must ignore the DO NOT TURN OFF sign to turn the machine off.

Gabe turned the machine off.

We were kind of stunned. Just shocked silence.

You didn't turn the machine off because you had to type in a boot loader to load the BASIC tape. So, we just leave it on.

But it was pretty funny.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 07, 2017 4:13 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
whartung wrote:
Back when we had our IMSAI 8080, we were showing it to one of the guys (Gabe)


I had an IMSAI when I was in high-school. I wasn't a very good student so I would use it to dial into the school's computer and change my grades. It was pretty easy to hack into the school because they always wrote the password down on a pull-out shelf. And since I was in trouble so much, I knew exactly where it was. It was usually "pencil".

I then tried to impress a girl with my computing abilities so I connected a speech synthesizer up and proceeded to start thermonuclear war with another computer called WOPR. Password to WOPR was "JOSHUA".

Man, those were the days...

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 10, 2017 11:20 pm 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
@whartung - exactly my own experience of computing in my early years (13 years old).

I learnt to program through typing in listings from magazines - hours of laborious typing, but the anticipation kept me going. However the most valuable aspect was to see how to do things like game loops, collision detection etc. from actual working programs. This enabled me to start writing my own games programs. Games for me as a teenager were an excellent motivation - to see if I could produce something as good or better than the BASIC programs in magazines of the day, but also because I didn't have much money to buy commercial games.

I also had some 'serious' problems to solve - some of my programs were development tools, such as sprite editors. One of my proudest achievements at the time was my own 6502 assembler written in BASIC. My folks could only just afford to buy me an entry level home computer, so I wasn't in a position to buy much software like games never mind less frivolous software which generally cost even more.

Winding forward 30 plus years (OMG, just writing that down boggles my brain), my 6502 home brew computer includes a self-written bespoke dialect of BASIC. So how to demonstrate the capabilities of this language - well, of course I wrote a couple of computer games. History does have a habit of repeating!!

Back on-topic, I agree that for newbies finding something which will be of use is a great motivator. And use can also include entertaining. Games will still require many programming constructs of serious applications - decisions, loops, subroutines / modules, input handing etc. So the skills gained will be transferable for other applications. And finally, games are very sociable - share with friends, siblings and grand-parents.

In fact, I am inspired to create a new app for my homebrew computer in time for Christmas - a couple of hours a week, should be ample time!


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 11, 2017 6:46 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Ah - you mentioned entertaining - which brings to mind another of the arts, namely music. Starting with random-pitched beeps, there's a lot you can do with sequenced sounds, and interactive sounds.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 26, 2017 8:58 am 
Offline

Joined: Tue Feb 24, 2015 11:07 pm
Posts: 81
I learnt to code with the intention of making computer games, though I never did finish any. Well, one. I think our school library started me off with Write your own Adventure Programs and though I made a sprite editor and font editor for the C64 and got my raster splits and sprite multiplexer going (I even got in colour-plexing after following the Roland brothers' development diary in Zzap64 as they created Creatures), I could never stay committed long enough to finish a game. That's why I liked books like the C16 Games Book by Melbourne House: Because the decisions were made for me so I wasn't mired in alternatives. I think this is why Arduino works as well: Just follow along, no need to wrestle with things that don't work.

After a lifetime of sporadically trying to make games and not completing any (though all of that time spent with OpenGL helped me to learn OpenSCAD quickly), the thing I'm most looking forward to when I finish my next 6502 SBC is some IoT task such as controlling a solenoid-activated watering valve over a 900 MHz radio.

When I was young, I wasn't interested in hardware or robotics at all and now that's mostly what I'm interested in, so I think motivation will be different for different people at different times.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 26, 2017 9:38 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
unclouded wrote:
When I was young, I wasn't interested in hardware or robotics at all and now that's mostly what I'm interested in, so I think motivation will be different for different people at different times.

It's an important point about beginnings - you don't yet know what is going to be your thing. That's why a well-prepared introduction into various possibilities has such value - not because of what you'll manage to do, or even what you'll learn, but because of the self-knowledge you might gain. A bit of hardware, a bit of software, a bit of documentation, a bit of teamwork, a bit of CPU design...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: