RIP to BT Garner of MindRec.com... BT passed away early 2023 from health problems. He was one of the top PCE homebrew developers and founder of the OG Turbo List, then PCECP.com. Condolences to family and friends.
IMG
IMG
Main Menu

Learn to code through a series of challenges?

Started by technozombie, 09/29/2016, 11:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

technozombie

So, like many people I've always want to learn to program/code, but have never really pursued it. I did take a beginners C++ class, and that is the extent of my experience. I've tried to watch Youtube videos, but I usually run into one of two scenarios. Number one: the beginner videos are for the absolute beginner and I get bored and distracted because I already know some of the stuff. Number two: most of the videos are in the format of "here type this,' and you are just following along trying to alt tab and type what they type.  I know there are several people on this site who program and I was hoping someone could issue me a series of challenges that increase in difficulty and complexity.

For example: Some experienced person says "Make a program that does 'X' thing" and then I go research on the internet and figure out how to do it, come back here with the source code, and proceed to the next challenge.

Also, if anyone else on the site is interested in participating in these proposed challenges then they are more than welcome. As a matter of fact if anyone has any good ideas on how to learn to code or even how to keep oneself focused on task/hobby/learning goal, then feel free to add that here. I get distracted easy, even when playing games I tend to play 4 or 5 in short bursts and seldom complete anything.

o.pwuaioc

What I did to brush up on things is to try to make one really big thing. I tried to create an in-depth data-analysis program in C using Win32. It helps to slowly add things here and there until you're competent. For Java, making a calculator got me to master some of the basics.

That said, I'd be interested. Are you still doing C++?

technozombie

I thought C++ would probably be the best way to go, but I'm open to other ideas.

elmer

Quote from: technozombie on 09/29/2016, 02:37 PMI thought C++ would probably be the best way to go, but I'm open to other ideas.
IMHO, it depends upon how much interest you have, and what your eventual goal is.

What kinds of things would you like to program?

If you can analyse why you have some interest in learning, then it would be easier to make recommendations.

Way back-in-the-day, everyone wanted to make simple games written in BASIC on home computers with simple graphics.

That's an excellent way to start because you get fast feedback, and learn simple logic.

And that's a skill that you can then build on to take the next step.

Learning from modern C++ aficionados who just want you to string together pre-written functions from the std:: namespace isn't going to teach you how to think and problem-solve, or much about how stuff really works.

technozombie

Well i definitely wouldn't mind learning to make simple games. Actually, my son likes to do some pixel art, and I would like use his art in a game as well as be able to teach him how to do it.

As far as why I have interest in learning, it's really because I like challenging myself with new things. I recently tiled in a shower in one of my bathrooms, it was a difficult, but rewarding experience. Like any kid who grew up with a Nintendo, I've pretty much always wanted to make my own game.

elmer

The whole pixel-art aspect can wait until you get a little further down the path!  :wink:

The classic starting-point is to recreate the old Atari "pong" game.

You can break it down into a number of steps ...

  • get a 1-pixel ball moving from the top-right of the screen to the middle-left of the screen
  • reset the position of the ball back to the top-right when it goes off the screen
  • add a "bat" on the left hand side of the screen, and bounce the ball off it when it reaches that point
  • allow a joystick to move the bat up-and-down under human control
  • get the ball to figure out whether it hits the bat (or not) when it gets to the left side of the screen
  • ... ... ... and then there's more when you get all of that working!

You could either do that in BASIC on a Commodore 64 (or an emulation of one), or in GameBASIC on a PC, or in HuC on the PCE (probably the hardest to do, but the one where you'll get the most help from other folks here).

Does that make any sense?

Arkhan Asylum

BASIC on PC is a good place to start learning programming.

anyone who tells you learning via BASIC is dumb, is dumb.

They even came back with BASIC for Windows, https://www.microsoft.com/en-us/download/details.aspx?id=22961
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

o.pwuaioc

Visual Basic is actually very useful for Excel macros. (Well, VBA.)

NightWolve

Quote from: guest on 09/29/2016, 11:50 PMVisual Basic is actually very useful for Excel macros. (Well, VBA.)
Ya know, I still use VBA under MS Access for my translation software. Access was a pretty competent solution to manage complex cases for what I did, games like Ys VI/Felghana/Ys Origin that separated the script out to ~1,300-1,766 individual files... I could abstract that into one database, one table, one view for the translation, and suddenly what was a nightmare or just not feasible, was a no-brainer (as in, why didn't I think of this sooner?), etc. Those projects would never have happened without Access!

In the case of Felghana, the translator could then translate the whole thing in 22 days as a result.. Of course, the bastard also then secretly exported the results to XSEED Games, got himself into the videogame industry off my back, ideas, work hours, etc. But yeah... Access is quite dandy if you learn how to make use of its power...and it led to XSEED getting a sweetheart deal where ~24,000 Falcom/Ys strings in total were pre-translated, ready for delivery/export, and not having to pay professionals at industry rates to start from scratch...

Anyway, for actual videogame development...well, I have actually seen games coded in good ole Visual Basic 6, straight up... It looks messy though, I'll say that...but, it's a great learning environment for sure! Why do I still like VB6 more than the mess that is VB.NET ??

technozombie

Quote from: elmer on 09/29/2016, 10:48 PMThe whole pixel-art aspect can wait until you get a little further down the path!  :wink:

The classic starting-point is to recreate the old Atari "pong" game.

You can break it down into a number of steps ...

  • get a 1-pixel ball moving from the top-right of the screen to the middle-left of the screen
  • reset the position of the ball back to the top-right when it goes off the screen
  • add a "bat" on the left hand side of the screen, and bounce the ball off it when it reaches that point
  • allow a joystick to move the bat up-and-down under human control
  • get the ball to figure out whether it hits the bat (or not) when it gets to the left side of the screen
  • ... ... ... and then there's more when you get all of that working!

You could either do that in BASIC on a Commodore 64 (or an emulation of one), or in GameBASIC on a PC, or in HuC on the PCE (probably the hardest to do, but the one where you'll get the most help from other folks here).

Does that make any sense?
This is what I'm looking for, some objectives to work on. I'm working the graveyard shift right now, but I'll try to start on this when I wake up tomorrow.

esteban

Quote from: technozombie on 09/30/2016, 12:54 AMThis is what I'm looking for, some objectives to work on. I'm working the graveyard shift right now, but I'll try to start on this when I wake up tomorrow.
YOUR OBJECTIVE: Develop a BLODIA clone after finishing PONG clone.

There will be no further warnings.

Your prime directive is BLODIA.
IMGIMG IMG  |  IMG  |  IMG IMG

OldMan

Quote...after finishing PONG clone
Pong is a good starting point, actually. Teaches the basics of joypad handling, sprite control and collision checks.

Follow it up with a breakout clone. That should teach you how to do quick screen updates and tile checks.

technozombie

If I can somehow find a way to do a Breakout/Blodia mashup then I'll really be onto something.

elmer

Quote from: TheOldMan on 09/30/2016, 02:00 AMPong is a good starting point, actually. Teaches the basics of joypad handling, sprite control and collision checks.

Follow it up with a breakout clone. That should teach you how to do quick screen updates and tile checks.
Exactly my thought!

I would avoid sprite-handling on pong, and just suggest developing it in a classic BASIC environment with a "plot" command to draw a point on the screen.

IMHO, it's best to get the basic programming thought-process (of de-composing a problem down into variables, conditionals, loops and subroutines) before dealing with stuff like sprites and attribute-tables.

Something on the PC that has a good debugger would be best, since a good debugger makes everything so much more pleasant, especially when you're starting off.

It doesn't look like Microsoft's SmallBasic has anything better than its version of "printf".

VB6 would be an alternative ... but you can't get hold of it freely.

Jeez ... why is it so difficult to find a simple environment with a decent debugger!

NightWolve

Quote from: elmer on 09/30/2016, 11:14 AMIt doesn't look like Microsoft's SmallBasic has anything better than its version of "printf".

VB6 would be an alternative ... but you can't get hold of it freely.

Jeez ... why is it so difficult to find a simple environment with a decent debugger!
I forget, but didn't VB.NET take away the instant code rewrite AND continue ability you had in VB 6 during debugging/tracing ? That's the thing I loved about it! When you grew up with TASM, Borland C++, etc. and encountered such a feature for the first time, it was amazing! Lot of my early work involved maintaining legacy apps, and nobody likes to document their shit, so if I had to debug to track down a problem, nothing was ever better than VB 6! Perhaps its power and ease allowed software developers to be a bit more lazy than they normally would though, but companies just want apps running as fast as possible and if they're mostly providing the needed solution, they don't care how messy things are under the hood.

elmer

#15
Quote from: NightWolve on 09/30/2016, 11:37 AMI forget, but didn't VB.NET take away the instant code rewrite AND continue ability you had in VB 6 during debugging/tracing ? That's the thing I loved about it!
I never actually used VB6 or VB.NET, just VBScript, so I don't really know.

They abandoned the old tried-and-trusted VB architecture and dived head-first into .NET, so the darned thing was fully-compiled and object-oriented in VB.NET ... and so is now a lousy learning tool, requiring too much higher-level event-based methodology.

At that point, it's no longer pickup-and-play, and you might as well learn VC++ or VC#.


Quote from: elmer on 09/30/2016, 11:14 AMVB6 would be an alternative ... but you can't get hold of it freely.

Jeez ... why is it so difficult to find a simple environment with a decent debugger!
Ahhhh ... Microsoft may have abandoned it, but your local friendly "abandonware" site should have a copy, complete with serial number.

Then you'd just have to apply the Visual Studio Service Pack 6 (that you can still download from Microsoft).

I just grabbed a copy for my own use since I only have VC++ 6, and not the full Visual Studio 6.  :D

<EDIT>

Here's an interesting article on simple graphics programming in VB6 ...

http://www.tannerhelland.com/39/vb-graphics-programming-0/

My feeling is that technozombie (or any new programmer) should just keep things as-simple-as-possible for his first programming, and just draw points, and maybe lines, because that avoids introducing too many new concepts at once.

NightWolve

Quote from: elmer on 09/30/2016, 01:08 PMAhhhh ... Microsoft may have abandoned it, but your local friendly "abandonware" site should have a copy, complete with serial number.

Then you'd just have to apply the Visual Studio Service Pack 6 (that you can still download from Microsoft).

I just grabbed a copy for my own use since I only have VC++ 6, and not the full Visual Studio 6.  :D
If one went this route, you'll need 98/ME/2K/XP/Vista as I could not get it installed on Windows 7 and I assume above that... The installer completely fails, and no compatibility mode settings will help. So on Windows 7 and forward, you'd need to make use of "Windows Virtual PC" AKA emulation and install Windows XP or something, to get max compatibility with legacy apps and a little more modern feel, plus it can succeed at being installed. If not, for sure it'll install on a Win98/ME virtual instance.

technozombie

I found this compiler called PlayBASIC, does it seem like the right choice to use for what is being suggested?

http://www.playbasic.com/features.php

ginoscope

I develop in Java and C# but I don't work in the game industry.   The thing with coding is that it's more about thinking how to solve the problem than it is typing.  I would agree that something like basic would be a good place to start learning.

NightWolve

#19
To get specific, I remember something called Game Maker from BITD. It'll let you export a game to all sorts of OS platforms too. Since is it a sort of RAD (Rapid Application Development) type builder, just around games versus general-use applications, I suspect it greatly helps people get started as quickly as possible, certainly easier than something like C++ which is more for advanced coders! It'll naturally include samples of simple games to get you started and learn from.

http://www.yoyogames.com/gamemaker/features

EDIT: Here ya go, jump right in from here with video tutorials:

Quote"MAKE YOUR FIRST GAME!
Difficulty: Beginner/Intermediate

A GameMaker: Studio tutorial for absolute beginners to go from nothing to a completed game using GML scripting, no experience necessary!"
http://www.yoyogames.com/learn

elmer

Quote from: ginoscope on 09/30/2016, 10:54 PMThe thing with coding is that it's more about thinking how to solve the problem than it is typing.  I would agree that something like basic would be a good place to start learning.
Yep, I absolutely agree. It's all about starting to think logically and break down problems.

The language doesn't really matter as long as it doesn't get in the way of that.

Some kind of structured-BASIC (i.e. no line-numbers) is perfect for that.

Then the beginner can transition to something more powerful later on (if they want to).


Quote from: NightWolve on 09/30/2016, 11:01 PMTo get specific, I remember something called Game Maker from BITD.

http://www.yoyogames.com/gamemaker/features
In my mind, that's just too big and full-featured a package to be the best starting point for learning.

It just throws too much capability at you, and provides too much of a library that will avoid the beginner from learning the basics.


Quote from: technozombie on 09/30/2016, 10:13 PMI found this compiler called PlayBASIC, does it seem like the right choice to use for what is being suggested?

http://www.playbasic.com/features.php
Yep, that looks OK from the feature-list. I don't know how stable or good it is to work with, but at least you can try things with the free edition before forking out your (very nicely priced) $15 for the full thing.

Just stick to drawing simple points and lines to start with for Pong, and then you can think about 2D sprites later on if you want to continue on to do Breakout/Arkanoid.


Quote from: NightWolve on 09/30/2016, 01:50 PM
Quote from: elmer on 09/30/2016, 01:08 PMAhhhh ... Microsoft may have abandoned it, but your local friendly "abandonware" site should have a copy, complete with serial number.
If one went this route, you'll need 98/ME/2K/XP/Vista as I could not get it installed on Windows 7 and I assume above that... The installer completely fails, and no compatibility mode settings will help.
Here's a method that's supposed to work for installing VB6 on later versions of Windows ...

http://stackoverflow.com/questions/10495680/installation-of-vb6-on-windows-7-or-windows-8-or-windows-10

NightWolve

Quote from: elmer on 10/01/2016, 01:37 PM
Quote from: NightWolve on 09/30/2016, 01:50 PMIf one went this route, you'll need 98/ME/2K/XP/Vista as I could not get it installed on Windows 7 and I assume above that... The installer completely fails, and no compatibility mode settings will help.
Here's a method that's supposed to work for installing VB6 on later versions of Windows ...

http://stackoverflow.com/questions/10495680/installation-of-vb6-on-windows-7-or-windows-8-or-windows-10
Ah, thanks very much man, I'll give it a shot... I still like having VB6 around and working... Call it nostalgia. ;)

elmer

Quote from: NightWolve on 10/01/2016, 01:53 PMAh, thanks very much man, I'll give it a shot... I still like having VB6 around and working... Call it nostalgia. ;)
You're welcome!  :)

I just installed it on my Win7 x64 laptop using one of my VC++ 6 product codes, and it's working fine.

The only thing that I needed to do differently was to put the zero-byte msjava.dll file in \Windows\SysWOW64\ instead of \Windows\.

So now I can run VB6 with SP6!

technozombie

I installed that PlayBasic and I'm working through a tutorial. We'll see what happens.

Trenton_net

This is just personal preference, but I found FreeBasic to be a good alternative for people looking to learn programming. It has most of the major features you'd want in a learning language, and it also cross-compiles easily in DOS, Windows, and Linux. It's nice being able to write your code once and have it work all over. But that's just me!

technozombie

The Playbasic is ok so far, ive started on my pong game and have both "paddles" on screen and controllable. I just need to implement a ball and I guess edge/ boundary detection. I'm working for the next 7 days so I won't ger much done.

elmer

Quote from: technozombie on 10/07/2016, 04:43 PMThe Playbasic is ok so far, ive started on my pong game and have both "paddles" on screen and controllable. I just need to implement a ball and I guess edge/ boundary detection. I'm working for the next 7 days so I won't ger much done.
Congratulations!  :)

Keep on plugging away at it when you have the time.


Quote from: Trenton_net on 10/06/2016, 05:01 PMThis is just personal preference, but I found FreeBasic to be a good alternative for people looking to learn programming. It has most of the major features you'd want in a learning language, and it also cross-compiles easily in DOS, Windows, and Linux.
I just took a look at the webpage for it, and it does seem quite nice.  :)

There are all the simple graphics modes and point/line draw that I'd recommend for the 1st project or two while learning.

It's got a debugger, too, although I would call raw GDB very user-friendly.

technozombie

I recently rediscovered my inspiration for coding.  :lol:

technozombie

I made my pong game, its very simple of course, but it works. I couldn't find a way to produce an executable file in the free version of PlayBASIC. If anyone wants to see it I'll try to post it tomorrow.

technozombie


NightWolve


technozombie

Quote from: NightWolve on 10/14/2016, 03:45 PM
Quote from: technozombie on 10/14/2016, 12:04 AMHere is the source code for my pong game if anyone wants to critique it. 

https://drive.google.com/open?id=0BzgVE6j9OyMTQWJlMkVvUmdIbDQ
And with only 3 pages of code. ;)
Lol, is that good or bad?  Its not really as feature rich as it could be.

NightWolve

#32
If it's actually playable and working, that reflects the power of the high-level language.

With CPUs getting faster and faster, you don't have to bother writing efficient code these days, or care as much about how many thousands of assembly instructions the compiler translates a line of your high-level code into, etc. You can just skip right into the creation process faster and faster... This is a good thing overall in principle I guess.

As a perfectionist though, something will always nag me at the back of my mind with like say Visual Basic executables, more so with the later .NET system... I can't escape it... I just...like producing Win32 executables that talk directly with the Operating System and skip over ANSI "C" wrapper functions that introduce 1,000 assembly instructions before finally calling the OS' API functions...

I dunno, but on the flipside, that's why I'm a slow coder. You can produce lots of software very quickly with RAD type app builders, but the bloat will always bother me even though it's becoming more and more negligible with modern CPUs... Java is still the exception I think, its runtime engine still sucks ballz running doggedly slow. The Operating System built with it for phones and other devices was horrible and died very quickly in favor of Linux variants like Android. I unfortunately bought an early-generation BluRay player with a Java Operating System, and sometimes I wanna break the thing in half!

incrediblehark

technozombie have you made any further progress? This thread is very interesting to me. I have wanted to learn myself since I was younger. A friend of mine started teaching himself python and gave me the book to learn as well but its more of a how to do something as opposed to why its done. After reading through this I think I may try starting with BASIC as well to get a better grasp on more fundamental concepts.

technozombie

I haven't really made any progress. I made my pong style game and never did any more. I get distracted really easy without set goals.

Galad

I think blitz basic is free,you could start with that and create a simple game.

http://www.bettiesart.com/tc/blitz/

Arkhan Asylum

http://smallbasic.com/

Microsoft came out with this awhile ago, and is your best bet for modern flailing.

Visual Studio has a free version with a debugger as well.

Knock M$ as much as you want, but I don't think anyone will disagree that their debugger is pretty much the best one available. 

This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

technozombie

I've always wanted to make a game, but I never really had a "vision" for what I wanted to make.

Arkhan Asylum

Quote from: technozombie on 06/28/2017, 04:35 PMI've always wanted to make a game, but I never really had a "vision" for what I wanted to make.
so make a game about someone who doesn't know what they want to make.

This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

technozombie

Quote from: Psycho Arkhan on 06/28/2017, 04:39 PM
Quote from: technozombie on 06/28/2017, 04:35 PMI've always wanted to make a game, but I never really had a "vision" for what I wanted to make.
so make a game about someone who doesn't know what they want to make.
Arkhan, you're such a genius will you take me on as you disciple.

Galad

Quote from: Psycho Arkhanso make a game about someone who doesn't know what they want to make.
:lol: that was great