Computer Science Canada I'm new, and here's my first program! |
Author: | WiiDS [ Tue Dec 05, 2006 8:30 am ] |
Post subject: | I'm new, and here's my first program! |
Hi, I've just registered as WiiDS, and I'm here to submit some Turing applications. I may not be here for long, but I hope you all will enjoy my applications. My first application is geared to kids, but it's still enjoyable for us people as well as adults. Enjoy! |
Author: | TokenHerbz [ Wed Dec 06, 2006 12:41 am ] |
Post subject: | |
If its geared for children, perhaps change the way they type in answers. 1) it asks your name, i type "george milton" (persay, for first and last) the game crash's. 2) your program expects integers. Put a string it crash's. Allow it to handle type-o's and reask the question. 3) Serval problems with your code to which you can improve on. Not bad for a first program, keep working at it. |
Author: | uberwalla [ Wed Dec 06, 2006 8:02 am ] |
Post subject: | |
ok, first of all u got all that if no or if naw and stuff instead of all that random and kinda useless lines. just put getch. then u can get character and say when you are ready press any key to continue or whatever. |
Author: | WiiDS [ Wed Dec 06, 2006 8:38 am ] |
Post subject: | |
Hey, you know that I just started Turing in September. I just learned about Getches recently. To be honest with you, I only make Turing programs at school, since I don't have it at home. I'm not the best programmer in the world, but thanks for your good comments! My next program is geared to pregnant mothers at their baby showers. It was technically made before my timetables program, but it's less likely to crash since the user can only inputs strings. I'll send out stand-alone programs of my first and second programs once they're perfected, and I'll send it to the audience that I'm aiming for, for that specific program. (And to you guys too if you want) Thanks again guys! |
Author: | WiiDS [ Wed Dec 06, 2006 8:40 am ] |
Post subject: | |
Oh, and by the way, the program asked for you FIRST name, not your full name. |
Author: | Tony [ Wed Dec 06, 2006 9:05 am ] |
Post subject: | |
WiiDS wrote: Oh, and by the way, the program asked for you FIRST name, not your full name.
Well the desired action is to disregard the input, and request it again, not crash at the first sight of abnormality. Oh, and if you are going to share your programs, I would strongly encourage to upload the source code - this way we can comment and make suggestions on your coding style and practices, as oppose to just the interface design |
Author: | WiiDS [ Wed Dec 06, 2006 9:15 am ] |
Post subject: | |
Tony wrote: WiiDS wrote: Oh, and by the way, the program asked for you FIRST name, not your full name.
Well the desired action is to disregard the input, and request it again, not crash at the first sight of abnormality. Oh, and if you are going to share your programs, I would strongly encourage to upload the source code - this way we can comment and make suggestions on your coding style and practices, as oppose to just the interface design Uhhhh.... source code? What's that? |
Author: | Tony [ Wed Dec 06, 2006 10:39 am ] |
Post subject: | |
funny. 1 - you don't need to quote my entire post if you reply right after. If you want, take just the sniplet you are replying to. 2 - I know you saw the comment I left you about your avatar size. While it was an improvement, 300 pixels wide is still twice as big as tollerated 150. Anything over is looked down upon for messing with the layout. |
Author: | WiiDS [ Thu Dec 07, 2006 9:04 am ] |
Post subject: | |
Here's the source code: loop cls var name : string put "What's your first name?" get name put "Hello ", name, ", get ready to practise your timestables!" var number : int put "What number do you want to practise on?" put "(Example: 1, 3, 5, 9, 10, 15, 9847, etc.)" get number var Answer : string put "Okay then, are you ready?" get Answer if Answer = "n" then put "Well... we're going to start anyway!" end if if Answer = "N" then put "Well... we're going to start anyway!" end if if Answer = "nah" then put "Well... we're going to start anyway!" end if if Answer = "Nah" then put "Well... we're going to start anyway!" end if if Answer = "no" then put "Well... we're going to start anyway!" end if if Answer = "No" then put "Well... we're going to start anyway!" end if if Answer = "naw" then put "Well... we're going to start anyway!" end if if Answer = "Naw" then put "Well... we're going to start anyway!" end if if Answer = "not" then put "Well... we're going to start anyway!" end if if Answer = "Not" then put "Well... we're going to start anyway!" end if if Answer = "negative" then put "Well... we're going to start anyway!" end if if Answer = "Negative" then put "Well... we're going to start anyway!" end if if Answer = "stop" then put "Well... we're going to start anyway!" end if if Answer = "Stop" then put "Well... we're going to start anyway!" end if if Answer = "y" then put "Alright then, let's start!" end if if Answer = "Y" then put "Alright then, let's start!" end if if Answer = "yes" then put "Alright then, let's start!" end if if Answer = "Yes" then put "Alright then, let's start!" end if if Answer = "ya" then put "Alright then, let's start!" end if if Answer = "Ya" then put "Alright then, let's start!" end if if Answer = "ye" then put "Alright then, let's start!" end if if Answer = "Ye" then put "Alright then, let's start!" end if if Answer = "yeah" then put "Alright then, let's start!" end if if Answer = "Yeah" then put "Alright then, let's start!" end if if Answer = "Positive" then put "Alright then, let's start!" end if if Answer = "positive" then put "Alright then, let's start!" end if if Answer = "go" then put "Alright then, let's start!" end if if Answer = "Go" then put "Alright then, let's start!" end if put "" put "Ready, set, GO!" put "" var Number : int var answer : int var answerr : int var count : int := 0 var right : int := 0 var wrong : int := 0 loop randint (Number, 1, 12) exit when count = 20 count := count + 1 put "Question #", count put number, " x ", Number, " = " .. get answer answerr := number * Number if answerr = answer then put "Correct!" right := right + 1 end if if answerr not = answer then put "Incorrect!" wrong := wrong + 1 end if put "" end loop var letter : string if right < 10 then letter := "F" end if if right = 10 then letter := "D" end if if right = 11 then letter := "D" end if if right = 12 then letter := "C" end if if right = 13 then letter := "C" end if if right = 14 then letter := "B" end if if right = 15 then letter := "B" end if if right = 16 then letter := "A" end if if right = 17 then letter := "A" end if if right = 18 then letter := "A+" end if if right = 19 then letter := "A+" end if if right = 20 then letter := "A++" end if var game : string if right = 20 then put "Wow ", name, "! You got Perfect!!!!!!!" end if put name, ", you got ", right, " correct, and ", wrong, " incorrect." put "Your mark is ", (right / 20) * 100, "%! (", letter,")" if right > wrong then put "Great job ", name, ", you passed! Care to try again?" end if if right < wrong then put "Too bad ", name, ", you failed! Care to try again?" end if get game exit when game = "n" exit when game = "N" exit when game = "nah" exit when game = "Nah" exit when game = "no" exit when game = "No" exit when game = "naw" exit when game = "Naw" exit when game = "not" exit when game = "Not" exit when game = "negative" exit when game = "Negative" exit when game = "stop" exit when game = "Stop" end loop |
Author: | wtd [ Thu Dec 07, 2006 12:10 pm ] |
Post subject: | |
Judging from your code, you would do well to read the style guidelines. |
Author: | CodeMonkey2000 [ Thu Dec 07, 2006 5:35 pm ] |
Post subject: | |
lol, WiiDS, how long did it take u to program that? sooo many ifs doing the same thing... |
Author: | ericfourfour [ Thu Dec 07, 2006 10:50 pm ] | ||
Post subject: | |||
Well, you could cut this in half by looking into Str.Lower and Str.Upper which convert a string's case. |
Author: | wtd [ Fri Dec 08, 2006 12:10 am ] |
Post subject: | |
And by using "or". This is covered in the style guidelines. |
Author: | md [ Fri Dec 08, 2006 12:49 am ] |
Post subject: | |
or... exit when str.Lower(game[1]) == "N" || "S" (psudo code like...) |
Author: | WiiDS [ Fri Dec 15, 2006 9:19 am ] |
Post subject: | |
Remember, I don't know everything about turing. I'm a n00b. (I can't belive I just said that.) |