Computer Science Canada

GRD 10 millionare game w/ 12.6 thousand lines of code

Author:  jdubzisyahweh [ Wed Feb 24, 2010 11:09 am ]
Post subject:  GRD 10 millionare game w/ 12.6 thousand lines of code

dont remember how to get music to run, pls help, see "menu" proc.

Author:  chrisbrown [ Wed Feb 24, 2010 12:36 pm ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

Quote:
12.6 thousand lines

You're doing it wrong.

Author:  Euphoracle [ Wed Feb 24, 2010 1:03 pm ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

methodoxx @ Wed Feb 24, 2010 12:36 pm wrote:
Quote:
12.6 thousand lines

You're doing it wrong.


You're doing it so wrong.

Author:  TerranceN [ Wed Feb 24, 2010 3:33 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

I thought this kind of thing (repetitive, tedious work) was what scared many people away from programming. Either I was completely wrong, or you are one hell of an outlier.

Anyway, you should just use a text file for all the questions and answers, then you just need to make 1 version of each procedure, and just load a new question and answers each time you need to.

Author:  jdubzisyahweh [ Thu Feb 25, 2010 11:11 am ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

i know!!!!!, just want to add music,,,, TELL ME HOW PLS

Author:  jdubzisyahweh [ Thu Feb 25, 2010 11:12 am ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

thanx though fer the text file thing, not sure how to do that either though

Author:  jdubzisyahweh [ Thu Feb 25, 2010 11:14 am ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

by the way, i find the tedious stuff sooooooooooooooooooooooooooo much fun!!!!
thats why i like to program

Author:  jdubzisyahweh [ Thu Feb 25, 2010 11:15 am ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

see "menu proc", want to add music!!!!!

Author:  DemonWasp [ Thu Feb 25, 2010 12:03 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

First, quadruple-posting is poor manners. Post everything in one go, or edit your last post.

Second, that "tedious work" is a terrible idea. It makes your program impossible to modify easily. If you wrote it properly, you'd have well under 500 lines, and changing something would be easy - you'd have to change it in exactly one place, not dozens scattered about your code.

Third, you need to start thinking about the properties of objects. For example, a question is an object. It has the question statement (a string), some number of answers (each of which is a string, hopefully in a list or array) and some concept of which answer is correct (probably an integer). That's what defines a question. Given that, you should be able to write a procedure which takes the question, gets the user's answer, determines whether they are correct, and responds appropriately. This shouldn't be more than 100 lines (probably about 20, more with graphics involved).

Author:  Turing_Gamer [ Thu Feb 25, 2010 12:46 pm ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

Wow people you don't know how to play music?
Turing:
process BGM
    Music.PlayFile ("YOUR_FILE.mp3")
                       -or-
    Music.PlayFile ("YOUR_FILE.wav")
                       -or-
    Music.PlayFile ("YOUR_FILE.MIDI")
                       -or-
    Music.PlayFileLoop ("YOUR_FILE.mp3")
                       -or-
    Music.PlayFileLoop ("YOUR_FILE.wav")
                       -or-
    Music.PlayFileLoop ("YOUR_FILE.MIDI")
end BGM
%Some code later
fork BGM % Play music in background
   -or-
BGM % Play music, halting program until it finishes.


Seriously, people.
Do we need to make a Tutorial about playing music in Turing?

Author:  USEC_OFFICER [ Thu Feb 25, 2010 12:48 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

Why? It is so simple. Also you don't need to use procedures, but without the fork the music will play over the background music. (Can't play two at once.) However whenever you want the music to stop, simply play a .mp3 or similar with nothing in it.

Author:  Turing_Gamer [ Thu Feb 25, 2010 12:50 pm ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

Or use Music.PlayFileStop

Author:  USEC_OFFICER [ Thu Feb 25, 2010 12:52 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

There was a problem with using it or something. Check the turing help files. It's in there.

Author:  mother teresa [ Thu Feb 25, 2010 5:22 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

hey when i try to run your game it wont allow me it says that you did not declare
f05
b1
b2
b3

Author:  chopperdudes [ Thu Feb 25, 2010 8:50 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

i know it's by the same OP... but doesn't the startup graphics look... rather similar to this? http://compsci.ca/v3/viewtopic.php?p=208071&no=1#208071

u can get it to at least run if you comment out those 4 lines of code. and he claims the other one he found 2 years ago, and only upgraded the graphics...

Author:  USEC_OFFICER [ Thu Feb 25, 2010 8:57 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

Except if he was smart enough he would realize that the other game is terrible and wouldn't have posted it at all. It always makes me wonder why some people post games that are terrible. A small percent sure, by why?

Author:  Zren [ Thu Feb 25, 2010 9:26 pm ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

They probably don't know much better

@Chopper: Though it runs into a logic loop when you comment out the lines and never actually start the millionaire game...

@jdubzisyahweh: You do know about procedures and parameters right? Here's an example of the structure flow of how the game might work differently and not calling the next procedure inside itself (though this could be achieved with recursion, but it would be terribly messy depending on how its done).

Turing:

procedure doQuestion (question : string, answers : array 1 .. 4 of string, correctAnswer : string)
    put question %Relace with sexy Font module.
    for i : 1 .. 4
        put i, ") ", answers (i)
    end for
    var usersAnswer : string
    get usersAnswer %Replace with ghastly GUI module stuff
    %Worst comes to worst, you need to submit a procedure into
    %The GUI button, make another procedure that changes the value
    %of a global variable with the value submitted into the procedure.

    if usersAnswer = correctAnswer then
        put "COOOOOOOOOOOOOORRECT!"
    else
        put "Nope"
    end if
end doQuestion

%The following is only an example of this procedure

%You could even break ans into 4 different string variables and change the parameters aswell.
var ans : array 1 .. 4 of string := init ("Canadians", "Chinese", "Americains", "Anarticains")
doQuestion ("Who's awesome?", ans, "1")



%The following code wont work properly without modification and uses stuff from the
%file module.

%open file
for i: 1..1 %Number of questions
%Change to loop and exit when statements to exit when you get a question wrong

    %extract question from file into variables and throw them into the procedure
    doQuestion ("Question", ans, "CorrectAnswer")
end for
%close file

Author:  chopperdudes [ Thu Feb 25, 2010 10:09 pm ]
Post subject:  RE:GRD 10 millionare game w/ 12.6 thousand lines of code

yeah i know it doesn't start but when i try to run a program and it's got <5 errors... i comment those out... and if it gives me more errors i just give up on it lol. but in this case it actually runs... (up to a point). and said "made only by jonathan wortner" or something... i was wonder if that code coulda been c/p'ed... or if that's him and he'd like to claim the other game to be his. lol

Author:  copthesaint [ Fri Feb 26, 2010 12:21 am ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

Euphoracle @ Wed Feb 24, 2010 wrote:
methodoxx @ Wed Feb 24, 2010 12:36 pm wrote:
Quote:
12.6 thousand lines

You're doing it wrong.


You're doing it so wrong.


Lol wrong would be a nice way of putting it.



Dont feel bad, there are many people like you. just either give up "the easy way out", Or think outside the box... and learn. Gl with whatever you choose.

Also if you want to use music:

copthesaint @ Fri Feb 05, 2010 wrote:


if you are are allowed to use, http://compsci.ca/v3/viewtopic.php?t=21388
This will let you play music without slowing your games accual speed.

Turing:
import (Launcher in "Launcher.tu")
var Music1 := Launcher.Open
var Music2 := Launcher.Open
Launcher.SendInfo (Music1, "HotNCold.mp3", 1, 0)
Launcher.SendInfo (Music2, "HotNCold.mp3", 1, 0)


First line:
Turing:
import (Launcher in "Launcher.tu")

This, loads the class 'Launcher' in Launcher.tu

Lines 2 and 3:
turning:
var Music1 := Launcher.Open
var Music2 := Launcher.Open

This initializes the music player.

Lines 4 and 5:
Turing:
Launcher.SendInfo (Music1, "HotNCold.mp3", 1, 0)
Launcher.SendInfo (Music2, "HotNCold.mp3", 1, 0)

Sends to each music player the information to play the song "HotNCold.Mp3" (just change this to your music file),
Tells the music player to run the song "1", and tells the music player not to terminate "0".


You Will need the files Run_Music.exe, and launcher.tu with you main program

There is also the sorce code for Run_Music.exe, but I dont think you will need to see it unless you are making an online game and need to change the port.

So really, This can be used for anything, The only problem is that you need an open window Sad I suggest if you want music and sound effects open two (like above) and just keep them open until your main program is terminated.


Should seriously sticky that program I made... lol and... yay :/ 300 post soooo.... happy lol :p

Author:  jdubzisyahweh [ Fri Feb 26, 2010 10:36 am ]
Post subject:  Re: RE:GRD 10 millionare game w/ 12.6 thousand lines of code

chopperdudes @ Thu Feb 25, 2010 8:50 pm wrote:
i know it's by the same OP... but doesn't the startup graphics look... rather similar to this? http://compsci.ca/v3/viewtopic.php?p=208071&no=1#208071

u can get it to at least run if you comment out those 4 lines of code. and he claims the other one he found 2 years ago, and only upgraded the graphics...

thats because the start up grfx are MINE!!!! and i posted both

Author:  jdubzisyahweh [ Fri Feb 26, 2010 11:05 am ]
Post subject:  Re: GRD 10 millionare game w/ 12.6 thousand lines of code

NEW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
MIllionare 2.5


: