This is a split board - You can return to the Split List for other boards.

Some questions for experienced programmers

#11SinisterSlayPosted 10/3/2013 8:08:41 AM(edited)
a_Wizards_Baker posted...
-CJF- posted...
Seems like most everyone so far has had some schooling in the matter. I hope not taking classes in programming will not be a handicap for me. :(



Honestly, you don't need to, but it will certainly help you over some of the hurdles of programming. Like some previous posters mentioned: C++ is difficult because the concepts involved (i.e. pointers). The language itself is very simple, but without taking classes i don't think i would have picked up those concepts as quickly from just reading a book.


That's why I say start with vbscript, and there is huge amounts of documentation on it.

Like, just open notepad.

Save as, choose, all files, and enter a name.vbs

Then, in the document, type

dim sMessage
sMessage="Hello World"
call msgbox(sMessage)


And there is your first hello world program.
Save the file, then double click the file to run it.
---
He who stumbles around in darkness with a stick is blind. But he who... sticks out in darkness... is... fluorescent! - Brother Silence
#12SinisterSlayPosted 10/3/2013 8:12:47 AM(edited)
SinisterSlay posted...

That's why I say start with vbscript, and there is huge amounts of documentation on it.

Like, just open notepad.

Save as, choose, all files, and enter a name.vbs

Then, in the document, type

dim sMessage
sMessage="Hello World"
call msgbox(sMessage)


And there is your first hello world program.
Save the file, then double click the file to run it.


And then, a bit of an extension with that. Lets make it say what we enter.

dim sMessage
sMessage=inputbox("Hi I am a parrot, what should I say?")
call msgbox("Caw! " & sMessage)

---
He who stumbles around in darkness with a stick is blind. But he who... sticks out in darkness... is... fluorescent! - Brother Silence
#13SinisterSlayPosted 10/3/2013 8:26:55 AM(edited)
SinisterSlay posted...
SinisterSlay posted...

That's why I say start with vbscript, and there is huge amounts of documentation on it.

Like, just open notepad.

Save as, choose, all files, and enter a name.vbs

Then, in the document, type

dim sMessage
sMessage="Hello World"
call msgbox(sMessage)


And there is your first hello world program.
Save the file, then double click the file to run it.


And then, a bit of an extension with that. Lets make it say what we enter.

dim sMessage
sMessage=inputbox("Hi I am a parrot, what should I say?")
call msgbox("Caw! " & sMessage)


And now, lets throw in some logic


dim sMessage 'Holds what you type
dim sMessages 'holds what you type split up by spaces
dim sParrotSpeak 'holds what the parrot will repeat back to you
dim iWords 'loop counter
'First, ask what the parrot will say
sMessage=inputbox("Hi I am a parrot, what should I say?")
'split out the spaces so we can get every word used
sMessages=split(sMessage," ")
'start the randomization
Randomize
'loop through every word, and randomly pick them
for iWords=lbound(sMessages) to ubound(sMessages) Step 1
If Rnd > .5 Then 'rnd generates a number between 0 and 1
'then append the words together
sParrotSpeak=sParrotSpeak & " " & sMessages(iWords)
End If
Next
'Parrots can't use punctuation, lets get rid of some of them
sParrotSpeak=Replace(sParrotSpeak,".","") 'remove periods
sParrotSpeak=Replace(sParrotSpeak,",","") 'remove commas
sParrotSpeak=Replace(sParrotSpeak,"!","") 'remove exclaimation marks
sParrotSpeak=Replace(sParrotSpeak,"?","") 'remove question marks

'Parrots always say caw first right?
sParrotSpeak="Caw! " & sParrotSpeak
'show the message from the parrot
call msgbox(sParrotSpeak,,"Parrot")


We now have a talking parrot program.
---
He who stumbles around in darkness with a stick is blind. But he who... sticks out in darkness... is... fluorescent! - Brother Silence