Is FreeBASIC good for beginners to progrmaming?

New to FreeBASIC? Post your questions here.
Post Reply
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

paul doe wrote:Just remembered two other board games that could be relatively easy to implement for learning purposes: Dominoes and Mahjong. Also, a relatively more sophisticated one could be Burako (either with Poker cards or with its own specialized pieces).
Good idea. I didn't think about those games. Im still trying to understand some of the concepts of how some commands work and what an overall program should look like. I will admit i find some words new to me and have kinda just read something and moved on not thinking about too hard. To be honest, the python book i was reading (Python crash course) explained programming concepts alot easier, but that doesn't mean i want to give up, it just means i need more time to understand things. I think typing out the example codes from the book im using will eventually get these concepts in my head and give me the muscle memory of typing said code. I also need to start working on my own small projects to get my creativity going and applying the things ive been able to understand.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Is FreeBASIC good for beginners to progrmaming?

Post by MrSwiss »

joeyxl wrote:... and applying the things ive been able to understand.
Maybe also "the other way 'round".
Meaning: small project to learn a new keyword, concept e.t.c.
(not necessarily useful for another purpose, except for "learning" and if kept "for reference")
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

MrSwiss wrote:
joeyxl wrote:... and applying the things ive been able to understand.
Maybe also "the other way 'round".
Meaning: small project to learn a new keyword, concept e.t.c.
(not necessarily useful for another purpose, except for "learning" and if kept "for reference")
I plan to keep everything i do. My train of thought is that when i want to use something, i can reference what i did and then understand how it works and how i can use it.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Is FreeBASIC good for beginners to progrmaming?

Post by MrSwiss »

Yes, that is exacly the way I've had in mind.

Another method of learning is:
look around the forum for code written by others.
Then play around with it, until you understand "how it works" and, perhaps "why it was done 'that way' and not another".

Keep in mind, that there is usually more than one way, to reach a specific result.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Is FreeBASIC good for beginners to progrmaming?

Post by BasicCoder2 »

@joeyxl
To be honest, the python book i was reading (Python crash course) explained programming concepts alot easier, but that doesn't mean i want to give up, it just means i need more time to understand things.
Although we all have different ways of learning for me it was by starting with simple code I fully understood which is a long way from writing even a simple tic tac toe game.

Ideally you just deal with each command and concept as needed for the program example and practice using it without trying to learn everything at once from a manual. Unlike Python you do need to define your variables. Python is a higher level language compared with C++ or BASIC.

I would start with the idea that you input data to a named storage location. You output data using the name of the storage location such as printing it with the PRINT command. And you can process data using the name of its storage location.

Code: Select all

'define (dimension) an integer storage place called myNumber
dim as integer myNumber
'define (dimension) a string storage place. A string is a list of numbers that represent the ascii code for a alphanumeric character.  
dim as string  myName 
'INPUT is the command that tells the computer to wait while something is typed in.
'PRINT is the command that tells the computer to print the contents of that variable.
INPUT myNumber
INPUT myName
PRINT myNumber
PRINT myName
SLEEP               'wait for keypress
Then you might learn the extensions of these commands.

Code: Select all

INPUT "Enter your number ";myNumber
INPUT "Enter your name ";myName
PRINT "Your number is";myNumber
PRINT "Your name is ";myName
SLEEP
So how far have you got?

You can do a lot of simple programs to get the idea of the basic concepts of programming before you take on writing games. I think practice, practice, practice solving simple programming problems is what is required, not simply trying to read other people's code unless it is fully explained at the beginner level.

A simple "game" to show some basic concepts is: "Guess the number between 1 and 9".

It has a DO LOOP and a WHILE WEND and RND which perhaps should be explained first?
That is where you might turn to the documentation on those particular key words.

Code: Select all

dim as integer guess     'storage for your guessed number
dim as integer answer    'storage for the random number
answer = int(rnd(1)*9)+1 'answer now has a random number between 1 and 9
print answer
do                       'set up a loop
    input "Enter a number between 1 and 9";guess  'input your guess
    while answer <> guess
        print "Sorry wrong number try again"
        input "Enter a number between 1 and 9";guess  'input your guess
    wend
loop until answer = guess  'go back to the statement after do if answer doesn't equal guess
print "GOT IT"
print "HIT ANY KEY TO EXIT"
sleep
My first programs were not games. They were things like book keeping for the family farm.

.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

BasicCoder2 wrote:@joeyxl
To be honest, the python book i was reading (Python crash course) explained programming concepts alot easier, but that doesn't mean i want to give up, it just means i need more time to understand things.
Although we all have different ways of learning for me it was by starting with simple code I fully understood which is a long way from writing even a simple tic tac toe game.

Ideally you just deal with each command and concept as needed for the program example and practice using it without trying to learn everything at once from a manual. Unlike Python you do need to define your variables. Python is a higher level language compared with C++ or BASIC.

I would start with the idea that you input data to a named storage location. You output data using the name of the storage location such as printing it with the PRINT command. And you can process data using the name of its storage location.

Code: Select all

'define (dimension) an integer storage place called myNumber
dim as integer myNumber
'define (dimension) a string storage place. A string is a list of numbers that represent the ascii code for a alphanumeric character.  
dim as string  myName 
'INPUT is the command that tells the computer to wait while something is typed in.
'PRINT is the command that tells the computer to print the contents of that variable.
INPUT myNumber
INPUT myName
PRINT myNumber
PRINT myName
SLEEP               'wait for keypress
Then you might learn the extensions of these commands.

Code: Select all

INPUT "Enter your number ";myNumber
INPUT "Enter your name ";myName
PRINT "Your number is";myNumber
PRINT "Your name is ";myName
SLEEP
So how far have you got?

You can do a lot of simple programs to get the idea of the basic concepts of programming before you take on writing games. I think practice, practice, practice solving simple programming problems is what is required, not simply trying to read other people's code unless it is fully explained at the beginner level.

A simple "game" to show some basic concepts is: "Guess the number between 1 and 9".

It has a DO LOOP and a WHILE WEND and RND which perhaps should be explained first?
That is where you might turn to the documentation on those particular key words.

Code: Select all

dim as integer guess     'storage for your guessed number
dim as integer answer    'storage for the random number
answer = int(rnd(1)*9)+1 'answer now has a random number between 1 and 9
print answer
do                       'set up a loop
    input "Enter a number between 1 and 9";guess  'input your guess
    while answer <> guess
        print "Sorry wrong number try again"
        input "Enter a number between 1 and 9";guess  'input your guess
    wend
loop until answer = guess  'go back to the statement after do if answer doesn't equal guess
print "GOT IT"
print "HIT ANY KEY TO EXIT"
sleep
My first programs were not games. They were things like book keeping for the family farm.

.
ill be quite blunt. ive been reading the old "Beginners gude to freebasic" and not the website. what a huge mistake. it has gone into detail without making things broken down into "beginner friendly" concepts. i think im going to just start over and use the website becuase i feel like i haven't really learned anything with big things like pointers and "loading this thing out of memory into another thing". I understand thoese are things i will eventually need to know, but the book really dives deep into "you already know how to program you should understand this" without warning the reader in the beginning.
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Is FreeBASIC good for beginners to progrmaming?

Post by deltarho[1859] »

joeyxl wrote:ll be quite blunt. ive been reading the old "Beginners gude to freebasic" and not the website.
When you refer to 'the website' do you mean this because that is very different to the book by Clark and Feagan. I gave a link to the pdf on page 2 of this thread - Jun 08, 2021 22:55. It is by Patrick Wilder (patrickw99).
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Is FreeBASIC good for beginners to progrmaming?

Post by BasicCoder2 »

@joeyxl

Having just glanced at the old "Beginners Guide to freebasic" I can see it isn't an easy introduction to programming, it is more a technical overview of the language itself. It is also assuming the use of an older version of FreeBASIC so the FBWiki would be a better reference once you have a grasp of the basic concepts of any programming language.
https://www.freebasic.net/wiki/DocToc

The Virtual Ink tutorial is also out of date and reads like a technical manual in that it doesn't really explain basic stuff like for/next loops or functions it only shows examples that use them.
Last edited by BasicCoder2 on Jun 13, 2021 21:11, edited 1 time in total.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

deltarho[1859] wrote:
joeyxl wrote:ll be quite blunt. ive been reading the old "Beginners gude to freebasic" and not the website.
When you refer to 'the website' do you mean this because that is very different to the book by Clark and Feagan. I gave a link to the pdf on page 2 of this thread - Jun 08, 2021 22:55. It is by Patrick Wilder (patrickw99).
i am referring to the link you shared.
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Is FreeBASIC good for beginners to progrmaming?

Post by deltarho[1859] »

The FBWiki is the ultimate read and the best way to use it is to click on FreeBASIC manual at the top right of the home page, or use BasicCoder2's DocToc link, and then click on 'Keywords - Alphabetical' or 'Keywords - Functional'; assuming that you have a keyword in mind.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

deltarho[1859] wrote:The FBWiki is the ultimate read and the best way to use it is to click on FreeBASIC manual at the top right of the home page, or use BasicCoder2's DocToc link, and then click on 'Keywords - Alphabetical' or 'Keywords - Functional'; assuming that you have a keyword in mind.
I actually downloaded it on my computer and am using the fbhelp GUI version to read the PRIMER and whatever else i want to figure out. I also figured out one of my problems. I am jumping ahead WAY to fast without playing around with things and it was overwhelming me. I'm not really used to programming so self - teaching myself is a but rusty so to speak. What I need to do is take baby steps instead of jumping from one thing right to another thinking ill be able to learn all of it very quickly.
deltarho[1859]
Posts: 4305
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Is FreeBASIC good for beginners to progrmaming?

Post by deltarho[1859] »

joeyxl wrote:thinking ill be able to learn all of it very quickly.
In the beginning it is a steep learning curve, and you will need good quality crampons. Everyone will tell you that the curve does start to dip.

When it starts being fun you will be home and dry and new stuff will be easier to grasp. When will that happen? How long is a piece of string?

A few years ago a friend, after I had written a few things for his hobby, fancied the idea of programming himself. I'd known him for a while and figured he would not take to it. He didn't. Image It is by no means everyone's 'cup of tea'.

I reckon that you could make it, but you will have testing times ahead.

I have been working on a function this last few days, but it was not behaving as it should. I am still not sure what the problem was but gave up on my approach and came at it from a different angle and cracked it allowing the project to advance. I will go back to the problem code because I really do need to know what the problem was. Of course, I could post the problem code and somebody, like fxm, will tell me what is wrong, but I would rather fathom it out myself. If I cannot, then I will post it because it will nag at me until I have an answer.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

deltarho[1859] wrote:
joeyxl wrote:thinking ill be able to learn all of it very quickly.
In the beginning it is a steep learning curve, and you will need good quality crampons. Everyone will tell you that the curve does start to dip.

When it starts being fun you will be home and dry and new stuff will be easier to grasp. When will that happen? How long is a piece of string?

A few years ago a friend, after I had written a few things for his hobby, fancied the idea of programming himself. I'd known him for a while and figured he would not take to it. He didn't. Image It is by no means everyone's 'cup of tea'.

I reckon that you could make it, but you will have testing times ahead.

I have been working on a function this last few days, but it was not behaving as it should. I am still not sure what the problem was but gave up on my approach and came at it from a different angle and cracked it allowing the project to advance. I will go back to the problem code because I really do need to know what the problem was. Of course, I could post the problem code and somebody, like fxm, will tell me what is wrong, but I would rather fathom it out myself. If I cannot, then I will post it because it will nag at me until I have an answer.
I think programming is something i will enjoy. I just need to take my time with it. So far its been fun making little programs and testing out the very basic things that freeBASIC has to offer. I don't know what it is, but i tried looking at python again, and i found it not fun to work with. Im not sure why, but there's something about writing code in freeBASIC that has a more fulfilling experience. Mabye its declaring variables. Who knows maybe I'm a weirdo.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Is FreeBASIC good for beginners to progrmaming?

Post by BasicCoder2 »

@deltarho[1859]
few years ago a friend, after I had written a few things for his hobby, fancied the idea of programming himself. I'd known him for a while and figured he would not take to it. He didn't. It is by no means everyone's 'cup of tea'.
Wanting to be able to do X isn't the same as wanting to do X.

Most of those young kids today "learning to code", perhaps using Scratch, will not end up as programmers. It will however give them an understanding of what is involved.

I had an English teacher relative wanting me to teach him programming as it would add to his wage. I knew within a very short time his heart wasn't in it and he quickly gave up. I wasn't able to pass on my interest or knowledge in electronics or programming to my children, they just weren't interested.

Of course wanting to do X doesn't mean you will be any good at doing X :) That doesn't really matter as long as you enjoy yourself. You don't have to make it to the French Open or the Wimbledon Championships and make lots of money to enjoy playing tennis.
joeyxl
Posts: 27
Joined: Jun 08, 2021 13:23
Location: Toronto, Canada

Re: Is FreeBASIC good for beginners to progrmaming?

Post by joeyxl »

So heres my first "program". its stupid simple but i actually plan on adding more to it as i learn more. Its an ATM machine.

Code: Select all

'ATM Machine
'By Joseph Turco

Dim As Single balance, deposit, withdrawl
Dim As String i

balance = 0
Print "Hello, and welcome to the atm software"
Do
	Print "Please make a choice." 
	Print "(1) balance" 
	Print "(2) deposit" 
	Print "(3) withdrawl" 
	Print "(0) exit"
	Input "", i
	If i = "1" Then
		Print "Your Balance is:"; balance
		Print
	ElseIf i = "2" Then
		Input "Please type in how much you would like to deposit:", deposit
		Print "OK, you deposited"; deposit
		balance += deposit
		Input " Would you like to see your balance?", i
		If i = "Yes" Then
			Print
			Print "Your Balance is:";balance
			Print
		EndIf
	ElseIf i = "3" Then 
		Input "Please type in how much you would like to withdraw:", withdrawl
	    Print "OK, you withdrew"; withdrawl
		balance -= withdrawl
		Input "Would you like to see your balance?", i
		If i = "yes" Then
			Print
			Print "Your balance is:" ;balance
			Print
		EndIf
		Print
	Elseif i = "0" Then Exit Do
	Else
		Print "that is not a valid selection, please try again"
	End If
Loop

Print "Thank you for using our service. goodbye"

Sleep
End
Please don't laugh too hard.
Post Reply