0 Members and 3 Guests are viewing this topic.
[url=http://ourl.ca/13209][img]http://userbars.removedfromgame.com/ub/flyingfisch312.png[/img][/url]
//Splash screen goes hereMenu "Stock Craze","Play",1,"Help",2,"Credits",3Lbl 1Prog "ENG"Lbl 2"help goes here"Lbl 3"Credits"
//Setup"FFSHBOOTDBLD..." -> Str 1 //puts all the names of the stocks in a string. must have 20 names, no more, no less.[[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100][100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,][0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,]] -> Mat A[[0][0]] -> Mat B[[1000][0][0][0]] -> Mat CWhile A = 1For 1 -> J to 20RandInt(1,10) -> SRand# -> RMat A[2,J] < Mat A[3,J] => P-1 -> PMat A[2,J] > Mat A[3,J] => P+1 -> PR > P*0.05+0.50 => 1 -> DR < P*0.05+0.50 => -1 -> DR = P*0.05+0.50 => 0 -> DRand# -> r //the r used here is the one that stand for radians, or whatever.S=1 => r*10 -> thetaS<3 => r*5 -> thetaS<6 => r*2 -> thetaS<10 => r -> theta//assigns the new priceD=1 => Mat A[2,J]+theta -> Mat A[1,J]D=1 => Mat A[2,J]-theta -> Mat A[1,J]D=1 => Mat A[2,J] -> Mat A[1,J]For 1 -> H to 20Mat A[1,H]+P -> P//end of "for" loopMat B[1,1] -> Mat B[2,1]P/20 -> Mat B[1,1]//end of "for" loopNextProg "Disp"For 1 -> I to 20//If exitE=1 => Break//else move each row down oneMat A[2,I] -> Mat A[3,I]Mat A[1,I] -> Mat A[2,I]//end "for" loopNext//End while loopWhileEnd//scoring system goes here//Thanks for playing message goes here
Lbl 01 -> B//Displays the UI//Begin pseudo-codeDisplay "Stock craze" in upper left corner of screenDisplay Mat C[2,1] on the upper right side of the screenDisplay "Day" to left of Mat C[2,1]Display "Average" just below "stock craze"Display Mat B[1,1] at leftDisplay a $ sign and amount of money (Mat C[1,1]) at bottom//end pseudo-code1->J1->K //#'s for K and J will be determined at a later date, I do not know what they will be right now :S0 -> LB*20 -> CFor C -> I to C+40 step 4StrMid(Str1,I,I+4) -> Str2 //extracts the name of stock from str1Text K,I,Str2//diplay names of first 10 stocksJ+15 -> JIf L=0then If J>58then 126/2 -> KIfEndIfEnd//end "for" loopNext//Displays prices of first 10 stocksB*10 -> C0 -> L1 -> J6 -> KFor C -> I to C+10Text K,J,Mat A[1,I]J+15 -> JIf L=0then If J>58then (126/2)+6 -> KIfEndIfEnd//end "for" loopNext//"for" loop is used as a timer hereFor 1 -> I to 1000Getkey -> GIf B=2 //if on page 2 (B is the page number)then If G=79 //79 = F1 keythen 1 -> B //Brings us to page 1Goto 0 //go back to top and display the next pageIfEndIfEndIf B=1then If G=29 //29 = F6 Keythen 2 -> BGoto 0IfEndIfEndIf G=78 //78=Shift Keythen 1 -> A //A is used to determine Bye or sell in prog "trade" (1 is buy, 2 is sell)Prog "TRADE"IfEndIf G=77 //77=Alpha Keythen 2 -> AProg "TRADE"IfEndNext
menu "STOCKS","STK1",... //list all stocksLbl 11 -> ZGoto XLbl 22 -> ZGoto X...Lbl XA=2 => Goto ZIf A=1then ClrTextLbl Y"How much do you want to buy"? -> AA*Mat A[1,Z] > Mat C[1,1] => Goto YMat C[1,1]-(A*Mat A[1,Z]) -> Mat C[1,1] //subtracts cost from cash on handA+Mat A[4,Z] -> Mat A[4,Z] //records how much stock you have, nowGoto 0IfEndLbl ZIf A=2then ClrTextLocate 1,1,"You have this amount of stock:"Locate 2,1,Mat A[4,Z]//little black triangle goes here to pause until user presses EXELbl WClrtext"how much do you want to sell"? -> AA > Mat A[4,Z] => Goto WMat C[1,1]+(A*Mat A[1,Z]) -> Mat C[1,1] //adds the amount sold to your total cashMat A[4,Z]-A -> Mat A[4,Z]IfEndLbl 0
"welcome to the world of computers, where everything seems to be based on random number generators"
GOOGNASDAQDOW JONES