Posted: Tue Oct 25, 2011 8:00 pm Post subject: Re: RE:how to write those funtions?
mirhagk @ 25/10/2011, 6:50 pm wrote:
Okay good, I'm glad. Actually this gave me an idea for the course in school, give students fuddled code, and tell them to fix it.
That would probably be excellent! Maybe even a glitch or two... (:
Sponsor Sponsor
Nick
Posted: Tue Oct 25, 2011 8:16 pm Post subject: RE:how to write those funtions?
A bit off topic here but @mirhagk, a common occurrence in my programming assignments is a half written piece of code. There may be variables declared, functions written, it may even run and do what it is coded to do right, but we have to add in extra functionality or, in the case it doesn't run, get it to run. Sometimes there are even calls to functions that don't exist... yet.
tg851
Posted: Wed Oct 26, 2011 10:12 am Post subject: Re: how to write those funtions?
what i mean by scrambled is turning this(our latest(easy level)scramble challenge)
Turing:
get terms
third := first + second
first :=1
first := second
endfor var first, second, third, terms :int for ctr: 1.. terms
second := third
put"Term #", ctr, " is ", first
put"Please enter the number of terms to display."
second :=1
into this
Turing:
var first, second, third, terms :int put"Please enter the number of terms to display." get terms
first :=1
second :=1
for ctr: 1.. terms
put"Term #", ctr, " is ", first
third := first + second
first := second
second := third
endfor
its a right pain to do,one of the most hated challenges in my class.it often results in us just brute forcing the code into working order on the harder ones.
QED
Posted: Thu Oct 27, 2011 10:43 am Post subject: RE:how to write those funtions?
If that's a typical computer programming assignment for you, then you're high school teacher is not doing his job correctly.
There's no educational value in deciphering a programmer's intent by re-ordering his code. None. It's time wasted that you'll never get back.
Insectoid
Posted: Thu Oct 27, 2011 10:56 am Post subject: Re: RE:how to write those funtions?
QED @ Thu Oct 27, 2011 10:43 am wrote:
If that's a typical computer programming assignment for you, then you're high school teacher is not doing his job correctly.
There's no educational value in deciphering a programmer's intent by re-ordering his code. None. It's time wasted that you'll never get back.
Agreed. Most of the time, when my prof expects me to complete or fix code, I just comment it all out and re-write from scratch. Not worth my time to fix it. Admittedly, fixing other peoples' code is a useful skill to have, but I simply haven't got enough time in an exam/lab to figure out what my prof is trying to do, and fix it (doesn't help that she goes out of her way to make her implementation the least efficient, obvious, or legible possible).
tg851
Posted: Thu Oct 27, 2011 10:58 am Post subject: Re: how to write those funtions?
QED i know, we've been in this class for 3 months and we've been barley finished FOR LOOPS,for peats sakes i figured that out in 2 days. I've been teaching myself along with asking my teacher for help on something new and thats if hes willing to help me at all.i currently make a working file writer and am working on a minor Turing based OS while most of the rest(2 other people are doing some stuff a few levels below me) of the class blunders along with simple loops.the class has been SUSFU since the start.
Insectoid
Posted: Thu Oct 27, 2011 11:08 am Post subject: RE:how to write those funtions?
Quote:
QED i know, we've been in this class for 3 months and we've been barley finished FOR LOOPS,for peats sakes i figured that out in 2 days. I've been teaching myself along with asking my teacher for help on something new and thats if hes willing to help me at all
Get used to this. 90% of what I know is self-taught. In high school, all you'll learn is basic (VERY basic) algorithms and syntax. 90% of your time will be spent on syntax. Syntax is worthless. As long as you know one language's syntax, you can figure out any other languages' on your own very quickly. If you're really interested in programming you'll spend that 90% syntax time on your own learning. It is not a crime to ignore your teacher if he isn't saying something worth hearing.
mirhagk
Posted: Thu Oct 27, 2011 9:06 pm Post subject: RE:how to write those funtions?
We really need to split the computer science class into the 2 levels that are allowed. A U course should not be as easy as the computer science class currently is, it should be somewhat difficult.
Sponsor Sponsor
Beastinonyou
Posted: Fri Oct 28, 2011 6:46 am Post subject: Re: how to write those funtions?
If some of you aren't challenged enough in your classes, and are working above and beyond the rest of your classmates, I could offer you an alternative.
Like I'm helping Aange10, I will send you a PDF of the assignment he gave us (I type out the assignment he gives us), and you can do that.
I'm currently on my 5th assignment, and they've all been a blast. They get more challenging as you go =P
oanh_goose
Posted: Mon Oct 31, 2011 9:43 am Post subject: Re: how to write those funtions?
this's wat i wrote.... anw thanks 4 those u guys helps
var num1, num2, num3 : int
function minimum (a, b, c : int) : int
if a <= b and a <= c then
result a
elsif b <= c and b <= a then
result b
elsif c <= a and c <= b then
result c
end if
end minimum
put "type in a 3 number"
get num1, num2, num3
put minimum (num1, num2, num3)
Velocity
Posted: Tue Nov 08, 2011 6:56 pm Post subject: RE:how to write those funtions?
@ emo
Definetly a troll.
@ tg851
That was very nice of you.
Tony
Posted: Tue Nov 08, 2011 7:34 pm Post subject: RE:how to write those funtions?
just to make sure we actually have some good code in here:
code:
function min_2(a,b : int) : int
if a <= b then
return a
else
return b
end if
end min_2
function min_3(a,b,c : int) : int
return min_2(min_2(a,b), c)
end min_3