|
|
#1 (permalink) |
|
New Member
![]() Join Date: Dec 2005
Posts: 12
|
I have been playing with computers for some time now, and id like to start learing programming. The only problem is i don't really know where to start. Any ideas pointing in the right direction would be greatly appreciated.
|
|
|
|
|
|
#2 (permalink) |
|
Silver Member
![]() Join Date: Sep 2004
Posts: 129
|
You can use tutorials to get you started.. but you really need a good book. I can't advice you on books tho. Also looking a snipets of code other people wrote can get you very far.
You also need to choose a language you wan't to program in. I heard delphi is good and made to learn programming. But people prefer c++ wich is more symbolic. There's also visual basic wich is really easy but it isn't really populair since it's not very strickt about your code. This makes code really hard to ready and makes bugs hard to find. And it's slow (you won't see much of a difference in smaller programs). Don't stick me to my words plz... i'm just a nublet myself. Edit: If anyone knows a good book plz post i'm searching one myself... for a beginnning programmer.Code:
program Lotto;
uses Crt;
function GetUserNumber : byte;
var
x: byte;
begin
read(x);
result := x;
end;
function GetComputerNumber : byte;
var
x: byte;
begin
randomize;
x := random(5) + 1;
result := x;
end;
procedure GameStart(var money: integer);
var
prize: byte;
x: array[1..5] of boolean;
counter: byte;
usernumber: array[1..5] of byte;
computernumber: array[1..5] of byte;
begin
writeln;
write('Please fill in your numbers (from 1 to 5) one at the time followed by an "Enter"');
writeln;
for counter := 1 to 5 do
begin
usernumber[counter] := GetUserNumber;
while (usernumber[counter] < 1) or (usernumber[counter] > 5) do
begin
writeln('Please choose a number from 1 to 5');
usernumber[counter] := GetUserNumber;
end;
computernumber[counter] := GetComputerNumber;
end;
ClrScr;
counter := 0;
writeln('Your Number Computer`s Number');
for counter := 1 to 5 do
writeln(usernumber[counter], ' ', computernumber[counter]);
counter := 0;
for counter := 1 to 5 do
begin
if usernumber[counter] = computernumber[counter] then
x[counter] := true
else
x[counter] := false
end;
if (x[1] = true) and (x[2] = true) and (x[3] = true) and (x[4] = true) and (x[5] = true) then
begin
prize := 5;
end
else if (x[1] = true) and (x[2] = true) and (x[3] = true) and (x[4] = true) then
begin
prize := 4;
end
else if (x[1] = true) and (x[2] = true) and (x[3] = true) then
begin
prize := 3;
end
else if (x[1] = true) and (x[2] = true) then
begin
prize := 2;
end
else if (x[1] = true) or (x[2] = true) or (x[3] = true) or (x[4] = true) or (x[5] = true) then
begin
prize := 1;
end
else
begin
prize := 0;
end;
money := money + prize;
writeln('You have won ', prize, ' credit(s)!!! You now have ' , money , ' credits left.');
end;
var
money: integer;
act: byte;
begin
money := 20;
writeln('Welcome to Lotto! written in Dev-Pascal by XXXXXXXX!');
writeln('You have 20 credits and every bet costs 2 credits.');
writeln;
act := 2;
while (act <> 1) and (money > 1) do
begin
money := money - 2;
writeln;
writeln('You have ', money, ' credits left!');
GameStart(money);
writeln;
writeln('Do you want to quit?');
writeln('Type 1 to quit or 2 to continue');
read(act);
while (act > 2) or (act < 1) do
begin
writeln('This option is invalid, please choose 1 to quit or 2 to continue');
read(act);
end;
end;
end.
![]()
__________________
Asus a8n-E AMD athlon64 3000+ venice core Gigabyte nVidia GF 6600GT 2x 512MB Kingston ddr pc3200 Seagate baracuda 80GB Sata Western Digital 160GB ATA Antec neoHE 430W Last edited by B-MAN; 04-19-2006 at 10:25 AM. |
|
|
|
|
|
#3 (permalink) |
|
VIP Member
![]() Join Date: Jan 2006
Location: Away for a while
Age: 49
Posts: 1,961
|
If you want to learn programming for your own use, books on their own are great.
If you want to learn programming in order to earn a living, a college diploma will be required. Tom
__________________
Frankenbox III: CPU: AMD Athlon 64 X2 4200+ *** MOBO: Biostar K8M800 Micro AM2 *** RAM: 2x1GB Kingston DDR2 667 HDD: WD 80GB Master, Seagate 320GB Slave *** DVD: Pioneer DVR-115DBK & LiteOn SOHW-812S DVD/CD burners PSU: Antec SmartPower 2.0 350W *** GPU: PNY GeForce FX5200 256MB AGP 8x *** MON: ViewSonic LCD VA721 CASE: eMachines *** SND: Diamond Xtreme 5.1 *** PRN: Epson C88+ *** OS: XP Home SP2 *** ROUTER: Linksys BEFSR41 |
|
|
|
|
|
#4 (permalink) |
|
Gold Member
![]() Join Date: Nov 2004
Age: 27
Posts: 365
|
Keep a look out for Ebooks or cheap books on Ebay, Visual Basic is about easiest as far as I know, I am currently learning Java with a learn from home college, its about a 12 month course depending on how much you put in each week and they find you a job on completion of your exams after the studying has finished.
If you want to learn just bits and peices for a one off project or don't want a career in programming then look on google for tutorials. Mike
__________________
I do whatever my rice crispies tell me to do ;) |
|
|
|
|
|
#5 (permalink) |
|
Silver Member
![]() Join Date: Feb 2006
Location: Texas, USA
Posts: 139
|
i'd recommend C++, Java, or C# for starters. try one of those 'learn C++ in 24 hours' books, they're usually quite good.
__________________
coolermaster praetorian, zalman silent cpu cooling, shin etsu grease Amd dual-core opteron 170 (denmark core), DFI lanparty UT NF4 Ultra-D 2Gb OCZ dual channel platinum 74Gb raptor, 250Gb SE16 Barracuda eVGA 7800GT OC SE Logitech mx518, x530 Enermax Liberty 500W PSU |
|
|
|
|
|
#7 (permalink) |
|
Diamond Member
![]() Join Date: Jul 2005
Location: Texas
Age: 17
Posts: 1,200
|
I know HTML (easy) and I'm almost done with Visual Basic. Visual Basic was very easy, but I also had a teacher helping me. Check to see if their are any classes available at your school. I know right now that I am taking BCP and I have learned HTML, Visual Basic, a little of C++ and a little of JavaScript.
Yes, I too want to get a very good book because after this year I am not going to be taking and more computer classes in order to persue a career in the health field.
__________________
XPS M1530 |
|
|
|
|
|
#10 (permalink) |
|
Diamond Member
![]() Join Date: Jul 2005
Location: Texas
Age: 17
Posts: 1,200
|
I just checked Amazon.com and they have 5,869 books on programming... It's got everything in here from C++ to graphics. Check it out, I'll give you guys the link if ya'll are interested.
http://www.amazon.com/gp/search/ref=...%3A3839&page=1
__________________
XPS M1530 |
|
|
|