Einzelnen Beitrag anzeigen
Alt 24.11.08, 21:11   #17 (permalink)
D31~$0u1
 
Registriert seit: 16.04.07
D31~$0u1 Leistung: Facit NTK
D31~$0u1 eine Nachricht über ICQ schicken
Likes: 0
Standard

Meine Lösung:

Meine Lösung in BlitzMax   

Code:
'Framework und import
Framework brl.Graphics
Import brl.Timer
Import brl.linkedlist
Import brl.D3D7Max2D
Import brl.Random
Import brl.StandardIO


Global KapitalS1:Int
Global KapitalS2:Int
Global Wuerfel1:Int
Global Wuerfel2:Int
Global Wuerfel3:Int
Global SumGes:Int
Global S1Vorteil:Int
Global S2Vorteil:Int

SeedRnd MilliSecs()

KapitalS1 = 1000
KapitalS2 = 1000

Function Vorteil1()
  S1Vorteil = S1Vorteil + 1
  Print "Vorteil für Spieler1"
  Print " "
EndFunction

Function Vorteil2()
  S2Vorteil = S2Vorteil + 1
  Print "Vorteil für Spieler2"
  Print " "
EndFunction



For i:Int = 1 To 2000
 Print i + ". Runde:"
 Print " "
  KapitalS1 = KapitalS1 - 10
  KapitalS2 = KapitalS2 + 10
	Wuerfel1 = Rnd(1, 6)
	Print Wuerfel1
	Wuerfel2 = Rnd(1, 6)
	Print Wuerfel2
	Wuerfel3 = Rnd(1, 6)
	Print Wuerfel3
	SumGes = Wuerfel1 + Wuerfel2 + Wuerfel3
 Print "Gewürfelt wurde insgesamt: " + SumGes
 Print " "

 If SumGes > 10 Then Vorteil1()
 If SumGes < 10 Then Vorteil2()
 
 KapitalS1 = KapitalS1 + SumGes
 KapitalS2 = KapitalS2 - SumGes
 
 Print "Kapital von Spieler1: " + KapitalS1
 Print "Kapital von Spieler2: " + KapitalS2
 Print "Ende Runde" + i
 Print " "

Next

Print "Endgültiges Kapital von Spieler1: " + KapitalS1
Print "Endgültiges Kapital von Spieler2: " + KapitalS2
Print "Gesamt Vorteile von Spieler1: " + S1Vorteil
Print "Gesamt Vorteile von Spieler2: " + S2Vorteil
Print " "
If S1Vorteil > S2Vorteil Then Print "Spieler1 hatte insgesamt " + (S1Vorteil - S2Vorteil) + "  Vorteile mehr als Spieler2"
If S1Vorteil < S2Vorteil Then Print "Spieler2 hatte insgesamt " + (S2Vorteil - S1Vorteil) + "  Vorteile mehr als Spieler1"
Print " "
If KapitalS1 > KapitalS2 Then Print "Spieler1 hat insgesamt " + (KapitalS1 - KapitalS2) + "  Euro mehr als Spieler2"
If KapitalS1 < KapitalS2 Then Print "Spieler2 hat insgesamt " + (KapitalS2 - KapitalS1) + "  Euro mehr als Spieler1"
WaitKey
end
D31~$0u1 ist offline   Mit Zitat antworten
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61