Old 13-11-2007   #1 (permalink)
pHi
Honorary Member
 
pHi's Avatar
 
Join Date: Jun 2006
Location: Gold Coast
Age: 22
Posts: 1,241
Rep Power: 4
Send a message via ICQ to pHi Send a message via MSN to pHi
Default any one a programmer?

nevermind

Last edited by pHi; 13-11-2007 at 03:33 PM..
pHi is offline   Reply With Quote
Old 13-11-2007   #2 (permalink)
Member
 
Join Date: Jul 2006
Posts: 153
Rep Power: 3
Default

post in the coding section genius.

or if that fails the coding section of overclockers because most people here just play source
maxim is offline   Reply With Quote
Old 13-11-2007   #3 (permalink)
Pro Member
 
nuk3's Avatar
 
Join Date: May 2006
Location: Sydney, Australia
Posts: 6,539
Rep Power: 9
Default

Quote:
Originally Posted by pHi View Post
You need an algorithm for counting votes for two candidates and declaring the winner or a tie. The user will be asked to enter: 1 for the first candidate, 2 for the second candidate, or 0 to stop counting and to display the result. Write the algorithm as pseudocode.

help? please?
cheers
Code:
set candidate1 to 0
set candidate2 to 0

while input not 0

	ask user for input

	if input equals 1
		 candidate1 = candidate1 + 1
	else if input equals 2
		candidate2 = candidate2 + 1

loop

print candidate1
print candidate2
just work from that to add in a check for a tie, etc, piece of cake, etc.

and learn to post in the correct forum.
__________________
OM NOM NOM
nuk3 is offline   Reply With Quote
Old 13-11-2007   #4 (permalink)
Member
 
Join Date: Dec 2006
Location: Melbourne
Age: 19
Posts: 111
Rep Power: 3
Default

edit:beaten to it :<
hst_ is offline   Reply With Quote
Old 13-11-2007   #5 (permalink)
Pro Member
 
chemicalNova's Avatar
 
Join Date: Jun 2006
Age: 19
Posts: 5,593
Rep Power: 8
Default

Oh my god.. Pseudo-code teachers are idiots.

Whats to gain from pseudo code... nothing. I HATE TEACHERS LIKE THAT.

chem
__________________
There are no stupid questions... but there are alot of inquisitive idiots.
-
chemicalNova is offline   Reply With Quote
Old 13-11-2007   #6 (permalink)
Pro Member
 
nuk3's Avatar
 
Join Date: May 2006
Location: Sydney, Australia
Posts: 6,539
Rep Power: 9
Default

Quote:
Originally Posted by chemicalNova View Post
Oh my god.. Pseudo-code teachers are idiots.

Whats to gain from pseudo code... nothing. I HATE TEACHERS LIKE THAT.

chem
some logic and design techniques I suppose.

they may as well teach LOLCODE instead imo.
__________________
OM NOM NOM
nuk3 is offline   Reply With Quote
Old 13-11-2007   #7 (permalink)
Member
 
Join Date: Jul 2006
Posts: 126
Rep Power: 3
Default

lolcode hahah yeh I was reading about that today on scott hanselmans blog. I love how you can exit a loop etc by writing "GTFO" hahahahah
nogusta is offline   Reply With Quote
Old 19-11-2007   #8 (permalink)
Contributing Member
 
Join Date: Jun 2006
Posts: 607
Rep Power: 3
Default

Quote:
Originally Posted by chemicalNova View Post
Oh my god.. Pseudo-code teachers are idiots.
Whats to gain from pseudo code... nothing. I HATE TEACHERS LIKE THAT.
chem
Actually, quite a ****ing lot.

Just not in dumb **** examples.

If you take an OS theory course you will most likely come to appreciate it quite a bit.
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature.
Khaless is offline   Reply With Quote
Old 19-11-2007   #9 (permalink)
Pro Member
 
chemicalNova's Avatar
 
Join Date: Jun 2006
Age: 19
Posts: 5,593
Rep Power: 8
Default

Quote:
Originally Posted by Khaless View Post
Actually, quite a ****ing lot.

Just not in dumb **** examples.

If you take an OS theory course you will most likely come to appreciate it quite a bit.
Thats my point.. it's all for dumb **** examples.. I mean, "Write pseudo-code for iterating through an array and displaying the contents"... HOW ****ING STUPID.

Granted, an OS theory course it would be handy.. breaking down a complex operation from an OS would make sense.. but loops? NUGGET PLEASE!

chem
__________________
There are no stupid questions... but there are alot of inquisitive idiots.
-
chemicalNova is offline   Reply With Quote
Old 19-11-2007   #10 (permalink)
Contributing Member
 
Join Date: Jun 2006
Posts: 607
Rep Power: 3
Default

Quote:
Originally Posted by chemicalNova View Post
but loops? NUGGET PLEASE!
For someone new, completely new to programming It makes sense. You don't have to teach them an often confusing syntax, along with the new (and for them, confusing) control flow.

I have actually been talking to academic staff and students about teaching programming quite a bit recently, with the re-formation of the cs stream at my uni. Needless to say, the politics is bull****, and the idiots are winning.

But this is an argument for another day (... a 30hr day!).
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature.
Khaless is offline   Reply With Quote
Old 19-11-2007   #11 (permalink)
GotGames Super Moderator
 
shotty tomato's Avatar
 
Join Date: Jun 2006
Location: 2230
Posts: 7,741
Rep Power: 10
Default

Quote:
Originally Posted by Khaless View Post
But this is an argument for another day (... a 30hr day!).
I'm sure if it was part of a delicious plan you could fit it into your day
shotty tomato is offline   Reply With Quote
Old 20-11-2007   #12 (permalink)
Contributing Member
 
Join Date: Jun 2006
Location: Sydney
Age: 21
Posts: 636
Rep Power: 3
Send a message via MSN to Henry
Default

The point of pseudocode is clearly for VB programmers. "errrr how do I do something in VB? I know I'll just write it in plain english and it'll work. YAY!"

Pseudocode is meant to be for people that don't have programming experience and need to learn how to structure arguments logically. I've seen some of the civil engineering people at uni try and code and the way that they try and structure it is quite hilarious
Henry is offline   Reply With Quote
Old 20-11-2007   #13 (permalink)
Contributing Member
 
Join Date: Jun 2006
Posts: 607
Rep Power: 3
Default

Quote:
Originally Posted by Henry View Post
Pseudocode is meant to be for people that don't have programming experience and need to learn how to structure arguments logically. I've seen some of the civil engineering people at uni try and code and the way that they try and structure it is quite hilarious
You have clearly missed the many academic papers and journals that present their arguments and examples using pseudo code.
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature.
Khaless is offline   Reply With Quote
Old 20-11-2007   #14 (permalink)
Contributing Member
 
Join Date: Jun 2006
Location: Sydney
Age: 21
Posts: 636
Rep Power: 3
Send a message via MSN to Henry
Default

Quote:
Originally Posted by chemicalNova View Post
Oh my god.. Pseudo-code teachers are idiots.

Whats to gain from pseudo code... nothing. I HATE TEACHERS LIKE THAT.

chem
That's what I'm getting at khaless. Pseudocode helps people new to coding learn the logic behind it. Not saying it isn't used in more advanced things as well. My bad for the ****ty sentence structure
Henry is offline   Reply With Quote
Old 27-11-2007   #15 (permalink)
Participating Member
 
atech's Avatar
 
Join Date: Jul 2007
Location: Gold Coast, QLD
Age: 21
Posts: 435
Rep Power: 2
Default

Quote:
Originally Posted by nuk3 View Post
some logic and design techniques I suppose.

they may as well teach LOLCODE instead imo.
hahahaha lolcode, nice.
__________________
CPU: Intel E8400 3GHz @ 3.6GHz [450x8] [1.34v] HSF: Thermalright Ultra 120 RAM: 2G Crucial Ballistix Tracer 1066MHz 5-5-5-15 @ 900MHz 4-4-4-12 [2.1v] MB: Gigabyte P35 DS3P GPU: Gigabyte 8800GTS 512Mb
atech is offline   Reply With Quote
Old 05-02-2008   #16 (permalink)
ivo
GotGames Moderator
 
ivo's Avatar
 
Join Date: Jun 2006
Location: Vic
Posts: 2,060
Rep Power: 5
Default

lolcode > pseudocode IMO

Half (or some margin) the benefit of it is it can be easily translated directly into most languages. So you write a general algorithm in pseudocode and a programmer of any taste can incorporate it easily.
__________________


"If you wanna get it through their head, talk to them ragely" - fakeh
ivo is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +10. The time now is 09:49 AM.


Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0