| Autor |
Beitrag |
Jethacker
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: Fr 21.01.05 21:29
So ich progge grade ein prog für die schule aber ich komm nich weiter meine frage is nur wie komme ich von einem punkt zurück zum Menü?
Ich hab mein game hier:
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: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184:
| program Lotto;
uses WinCrt;
Var ihre_zahl, zufallszahl, lottozahl : array[1..6] of integer; i_z, x, zz, lz :integer; kapital, lose : real; datei : textfile; case1, case2, case2_1 : char;
begin
writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); writeln;writeln;
writeln('Bitte wählen Sie einen Schwiriegkeitsgrad!'); writeln('1 -> Leicht (Geld: 1000, Lose: 5 )'); writeln('2 -> Mittel (Geld: 500, Lose: 3 )'); writeln('3 -> Schwer (Geld: 200, Lose: 1 )'); writeln; readln(case1);
case case1 of '1' : begin kapital := 1000; lose := 5; end; '2' : begin kapital := 500; lose := 3; end; '3' : begin kapital := 200; lose := 1; end; end;
clrscr;
writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('|-------------------------------|'); writeln('| Was wollen Sie tun ? |'); writeln('\###############################/'); writeln('/###############################\'); writeln('|1 -> Los Benutzen <- 1|'); writeln('|2 -> Neues Los kaufen <- 2|'); writeln('|3 -> Los Verkaufen <- 3|'); writeln('|4 -> Speichern <- 4|'); writeln('|5 -> Beenden <- 5|'); writeln('|-------------------------------|'); writeln; writeln; readln(case2);
case case2 of
'1' : begin
ClrScr;
randomize;
assign(datei, 'Lotto.txt'); rewrite(datei);
Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln;writeln;
cursorto(60,0); writeln(' | Geld : ',kapital:5:2);
for i_z := 1 to 6 do begin Write('Geben Sie ihren Tipp ',i_z,' an (1-49) : '); readln(ihre_zahl[i_z]);writeln; end;
clrscr;
for zz := 1 to 6 do begin
zufallszahl[zz] := random(49) +1;
if ihre_zahl[i_z] = zufallszahl[zz] then begin write('Tipp richtig | ');write(datei,'Tipp richtig | '); end else begin write('Tipp falsch | ');write(datei,'Tipp falsch | '); end;
writeln('Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); writeln(datei,'Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); end;
close(datei);
end;
'2' : begin
ClrScr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('1 -> Los Kaufen'); writeln('2 -> Zurück'); readln(case2_1); case case2_1 of '1' : lose := +1;
'2' : end;
end; end;
end. |
so und wie komm ich jetzt von dem Punkt:
case2 ----> unterpunkt 2 ----> option 1 (case2_1) ----> rechnung (noch nich fertig)
das ist der bereich in "los kaufen"
Wie komm ich denn jetzt nach der rechnung zurück ins Menü?
Das wäre nett zu erfahren!
Interesant wäre auch:
Was kann ich denn bitte machen um eine wiederholung der abfrage zu starten fals zb im menu 9 gedrückt und bestätigt wird obwohl nur 1-4 möglich ist?
Danke schonmal
ach und fals ich das falsche Forum hab sorry
hatte keine ahnung wos rein sollte!
Moderiert von Christian S.: Code- durch Delphi-Tags ersetzt.
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: Fr 21.01.05 21:55
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|
Jethacker
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: Fr 21.01.05 22:32
Neues problem
so ich hab jetzt das gemacht:
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: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197:
| program Lotto;
uses WinCrt;
Var ihre_zahl, zufallszahl, lottozahl : array[1..6] of integer; i_z, x, zz, lz :integer; kapital, lose : real; datei : textfile; case1, case2, case2_1 : char;
label menu;
begin clrscr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); writeln;writeln;
writeln('Bitte wählen Sie einen Schwiriegkeitsgrad!'); writeln('1 -> Leicht (Geld: 1000, Lose: 5 )'); writeln('2 -> Mittel (Geld: 500, Lose: 3 )'); writeln('3 -> Schwer (Geld: 200, Lose: 1 )'); writeln; readln(case1);
case case1 of '1' : begin kapital := 1000; lose := 5; end; '2' : begin kapital := 500; lose := 3; end; '3' : begin kapital := 200; lose := 1; end; end;
clrscr;
menu:
begin
writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('|-------------------------------|'); writeln('| Was wollen Sie tun ? |'); writeln('\###############################/'); writeln('/###############################\'); writeln('|1 -> Los Benutzen <- 1|'); writeln('|2 -> Neues Los kaufen <- 2|'); writeln('|3 -> Los Verkaufen <- 3|'); writeln('|4 -> Speichern <- 4|'); writeln('|5 -> Beenden <- 5|'); writeln('|-------------------------------|'); writeln; writeln; readln(case2);
case case2 of
'1' : begin
ClrScr;
randomize;
assign(datei, 'Lotto.txt'); rewrite(datei);
Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln;writeln;
cursorto(60,0); writeln(' | Geld : ',kapital:5:2);
for i_z := 1 to 6 do begin Write('Geben Sie ihren Tipp ',i_z,' an (1-49) : '); readln(ihre_zahl[i_z]);writeln; end;
clrscr;
for zz := 1 to 6 do begin
zufallszahl[zz] := random(49) +1;
if ihre_zahl[i_z] = zufallszahl[zz] then begin write('Tipp richtig | ');write(datei,'Tipp richtig | '); end else begin write('Tipp falsch | ');write(datei,'Tipp falsch | '); end;
writeln('Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); writeln(datei,'Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); end;
close(datei);
end;
'2' : begin
ClrScr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('1 -> Los Kaufen (Kosten 10€)'); writeln('2 -> Zurück'); readln(case2_1); case case2_1 of '1' : begin lose := lose + 1; kapital := kapital - 10; goto menu end; '2' : goto menu end;
ClrScr;
end; end; end; end. |
Ich hab einfach dieses
Delphi-Quelltext
vor begin gesetzt aber das prob is jetzt das ich damit nur menu setzten kann kann ich auch das hier machen?
in
menu
los
geld
per goto springen lassen?
wenn ja wie?
bei mir zeigt der immer nen fehler an!
gibt es auch ne möglichkeit das ich jeden bereich mit begin und end laufen lasse ohne das ich end. schreiben muss?
sonst ist das programm doch zuende!
end; geht ja nich!
schaut hier:
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: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78:
| Var ihre_zahl, zufallszahl, lottozahl : array[1..6] of integer; i_z, x, zz, lz :integer; kapital, lose : real; datei : textfile; case1, case2, case2_1 : char;
label menu;
begin clrscr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); writeln;writeln;
writeln('Bitte wählen Sie einen Schwiriegkeitsgrad!'); writeln('1 -> Leicht (Geld: 1000, Lose: 5 )'); writeln('2 -> Mittel (Geld: 500, Lose: 3 )'); writeln('3 -> Schwer (Geld: 200, Lose: 1 )'); writeln; readln(case1);
case case1 of '1' : begin kapital := 1000; lose := 5; end; '2' : begin kapital := 500; lose := 3; end; '3' : begin kapital := 200; lose := 1; end; end;
clrscr; end;
menu:
begin
writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('|-------------------------------|'); writeln('| Was wollen Sie tun ? |'); writeln('\###############################/'); writeln('/###############################\'); writeln('|1 -> Los Benutzen <- 1|'); writeln('|2 -> Neues Los kaufen <- 2|'); writeln('|3 -> Los Verkaufen <- 3|'); writeln('|4 -> Speichern <- 4|'); writeln('|5 -> Beenden <- 5|'); writeln('|-------------------------------|'); writeln; writeln; readln(case2);
end; |
danke nochmal
Moderiert von Christian S.: Code- durch Delphi-Tags ersetzt.
|
|
Jethacker
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: Fr 21.01.05 23:42
so jetzt bin ich schon schlauer geworden aus dem goto kram danke!
Aber jetzt hab ich ein mergwürdiges prob!
seht in meinem code:
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: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237:
| program Lotto;
uses WinCrt;
Var ihre_zahl, zufallszahl, lottozahl : array[1..6] of integer; i_z, x, zz, lz :integer; kapital,kapital_r,lose : real; datei : textfile; case1, case2, case2_2_1 : char;
label menu;
begin clrscr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); writeln;writeln;
writeln('Bitte wählen Sie einen Schwiriegkeitsgrad!'); writeln('1 -> Leicht (Geld: 100, Lose: 5 )'); writeln('2 -> Mittel (Geld: 50, Lose: 3 )'); writeln('3 -> Schwer (Geld: 20, Lose: 1 )'); writeln; readln(case1);
case case1 of '1' : begin kapital := 1000; lose := 5; end; '2' : begin kapital := 500; lose := 3; end; '3' : begin kapital := 200; lose := 1; end; end;
clrscr;
begin
menu:
writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('|-------------------------------|'); writeln('| Was wollen Sie tun ? |'); writeln('\###############################/'); writeln('/###############################\'); writeln('|1 -> Los Benutzen <- 1|'); writeln('|2 -> Neues Los kaufen <- 2|'); writeln('|3 -> Los Verkaufen <- 3|'); writeln('|4 -> Speichern <- 4|'); writeln('|5 -> Beenden <- 5|'); writeln('|-------------------------------|'); writeln; writeln; readln(case2);
case case2 of
'1' : begin
ClrScr;
randomize;
assign(datei, 'Lotto.txt'); rewrite(datei);
Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln;writeln;
cursorto(60,0); writeln(' | Geld : ',kapital:5:2);
for i_z := 1 to 6 do begin Write('Geben Sie ihren Tipp ',i_z,' an (1-49) : '); readln(ihre_zahl[i_z]);writeln; end;
clrscr;
for zz := 1 to 6 do begin
zufallszahl[zz] := random(49) +1;
if ihre_zahl[i_z] = zufallszahl[zz] then begin write('Tipp richtig | ');write(datei,'Tipp richtig | '); end else begin write('Tipp falsch | ');write(datei,'Tipp falsch | '); end;
writeln('Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); writeln(datei,'Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); end;
close(datei);
end;
'2' : begin
ClrScr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('1 -> Los Kaufen (Kosten 10Geld)'); writeln('2 -> Zurück'); readln(case2_2_1); case case2_2_1 of '1' : begin lose := lose + 1; kapital := kapital - 10; goto menu end; '2' : goto menu; end;
'3' : begin
ClrScr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
writeln('1 -> Los Verkaufen (Verdienst 7Geld)'); writeln('2 -> Zurück'); readln(case2_2_1); case case2_2_1 of '1' : begin lose := lose - 1; kapital := kapital + 7; goto menu end; '2' : goto menu; end;
'4' : begin writeln('hallo');
'5' : begin
ClrScr; writeln('==============================================================================='); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
readln; donewincrt
end; end; end; end. |
normalerweise kann man ja ewig viele nummern nehmen bei case
aber komischerweise darf ich bei meiner case2 variablen nicht mehr als 2 stück nutzen woran liegt das?
kann mir da einer helfen?
Moderiert von Christian S.: Code- durch Delphi-Tags ersetzt.
|
|
Christian S.
      
Beiträge: 20451
Erhaltene Danke: 2264
Win 10
C# (VS 2019)
|
Verfasst: Fr 21.01.05 23:45
Hallo, Jethacker!
Bitte nutze für Deinen Delphi-Code die Delphi- anstatt der Code-Tags. Dadurch wird der Sourcecode mit Syntax-Highlighting angezeigt!
Danke
Christian 
_________________ Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: Sa 22.01.05 00:16
ich weis nicht obs stimmt, aber soweit ich weis kann man keinen string für case benutzen... nimm integer.
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8:
| var x:String; Case2:Integer; begin
readln(x); Case2:=StrToInt(x); case Case2 of |
das sollte dann klappen...
Achja: Bitte IMMER fehlermeldungen mit posten.. einfach die Zeile im Compilerfenster markieren und STRG+C ...
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|
Jethacker
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: Sa 22.01.05 02:24
So jetzt hab ich das meiste nach meinen wünschen hinbekommen nur
nett wäre wenn mir noch jemand sagen könnte was ich bei 6 richtigen machen muss damit er das erkennt und dem spieler dann sagen wa mal 1000 Geld dafür gibt?
und gibt es auch ne möglichkeit da computergegner reinzuhauen?
ach hier der quellcode mit richtigem *code
Sorry noma
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: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501:
| program Lotto;
uses WinCrt;
Var ihre_zahl, zufallszahl, lottozahl : array[1..6] of integer; i_z, zz, lz :integer; kapital, lose : real; datei, save : textfile; case1, case2, case2_1_1, case2_2_1, case2_5_1, case2_6_1 : integer;
label menu;
begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); writeln;writeln;
cursorto(50,20); writeln('Made by Jethacker'); cursorto(31,12); writeln('Under Construction'); cursorto(50,22); writeln('Since January the 1th 2005'); cursorto(50,23); writeln('Last Refresh: January 22.2005'); cursorto(50,24); writeln('Version: 0.09'); cursorto(49,11); readln;
begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); writeln;writeln;
cursorto(16,8); writeln('|==========================================|'); cursorto(16,9); writeln('|Bitte wählen Sie einen Schwierigkeitsgrad!|'); cursorto(16,10); writeln('\##########################################/'); cursorto(16,11); writeln('/##########################################\'); cursorto(16,12); writeln('|1 -> Leicht (Geld: 100, Lose: 5 ) |'); cursorto(16,13); writeln('|------------------------------------------|'); cursorto(16,14); writeln('|2 -> Mittel (Geld: 50, Lose: 3 ) |'); cursorto(16,15); writeln('|------------------------------------------|'); cursorto(16,16); writeln('|3 -> Schwer (Geld: 20, Lose: 1 ) |'); cursorto(16,17); writeln('|==========================================|'); writeln; readln(case1);
case case1 of 1 : begin kapital := 1000; lose := 5; end; 2 : begin kapital := 500; lose := 3; end; 3 : begin kapital := 200; lose := 1; end; end;
begin
menu: ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(60,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('Lose : ',lose:5:0,' |'); writeln('==============================================================================='); writeln;writeln;
cursorto(16,6); writeln('|==========================================|'); cursorto(16,7); writeln('| Was wollen Sie tun ? |'); cursorto(16,8); writeln('\##########################################/'); cursorto(16,9); writeln('/##########################################\'); cursorto(16,10); writeln('|1 -> Los Benutzen |'); cursorto(16,11); writeln('|------------------------------------------|'); cursorto(16,12); writeln('|2 -> Neues Los kaufen |'); cursorto(16,13); writeln('|------------------------------------------|'); cursorto(16,14); writeln('|3 -> Los Verkaufen |'); cursorto(16,15); writeln('|------------------------------------------|'); cursorto(16,16); writeln('|4 -> Speichern |'); cursorto(16,17); writeln('|------------------------------------------|'); cursorto(16,18); writeln('|5 -> Laden |'); cursorto(16,19); writeln('|------------------------------------------|'); cursorto(16,20); writeln('|6 -> Beenden |'); cursorto(16,21); writeln('|==========================================|'); writeln; writeln; readln(case2);
case case2 of
1 : begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
cursorto(16,8); writeln('|==========================================|'); cursorto(16,9); writeln('| Neues Los Kaufen ? |'); cursorto(16,10); writeln('\##########################################/'); cursorto(16,11); writeln('/##########################################\'); cursorto(16,12); writeln('|1 -> Lotto System Starten |'); cursorto(16,13); writeln('| (Pro richtige Antwort gibt es 4 Geld) |'); cursorto(16,14); writeln('|------------------------------------------|'); cursorto(16,15); writeln('|2 -> Zurück ins Menu |'); cursorto(16,16); writeln('|==========================================|'); readln(case2_1_1);
case case2_1_1 of
1 : begin
ClrScr;
randomize;
assign(datei, 'Lotto.txt'); rewrite(datei);
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(60,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('Lose : ',lose:5:0,' |'); writeln('==============================================================================='); writeln;writeln;
for i_z := 1 to 6 do begin Write('Geben Sie ihren Tipp ',i_z,' an (1-49) : '); readln(ihre_zahl[i_z]);writeln; end;
clrscr;
for zz := 1 to 6 do begin zufallszahl[zz] := random(2) +1;
if ihre_zahl[i_z] = zufallszahl[zz] then begin write('Tipp richtig | ');write(datei,'Tipp richtig | '); kapital := kapital + 4; end else begin write('Tipp falsch | ');write(datei,'Tipp falsch | '); end;
writeln('Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[zz], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); writeln(datei,'Ihr Tipp Nummer ',zz,'. : ',ihre_zahl[i_z], ' | Die ',zz,'. Lottozahl: ',zufallszahl[zz]); end;
close(datei);
writeln;writeln; cursorto(16,15); write('Drücke Enter um zum Menu zurück zu kehren'); cursorto(16,16); write('(Daten in Text Datei, Lotto.txt, gespeichert!'); cursorto(16,17); write(' Wird bei neuer nutzung überschrieben,'); cursorto(16,18); write(' bei benötigung, Datei Sichern!)'); readln; lose := lose -1; goto menu; end;
2 : goto menu; end; end;
2 : begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(20,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('| Lose : ',lose:5:0); writeln('==============================================================================='); writeln;writeln;
cursorto(16,8); writeln('|==========================================|'); cursorto(16,9); writeln('| Neues Los Kaufen ? |'); cursorto(16,10); writeln('\##########################################/'); cursorto(16,11); writeln('/##########################################\'); cursorto(16,12); writeln('|1 -> Los Kaufen (Kosten 10Geld) |'); cursorto(16,13); writeln('|------------------------------------------|'); cursorto(16,14); writeln('|2 -> Zurück ins Menu |'); cursorto(16,15); writeln('|==========================================|'); readln(case2_2_1);
case case2_2_1 of 1 : begin lose := lose + 1; kapital := kapital - 10; goto menu end;
2 : goto menu; end; end;
3 : begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(60,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('Lose : ',lose:5:0,' |'); writeln('==============================================================================='); writeln;writeln;
cursorto(16,8); writeln('|==========================================|'); cursorto(16,9); writeln('| Los Verkaufen ? |'); cursorto(16,10); writeln('\##########################################/'); cursorto(16,11); writeln('/##########################################\'); cursorto(16,12); writeln('|1 -> Los Verkaufen (Verdienst 7Geld) |'); cursorto(16,13); writeln('|------------------------------------------|'); cursorto(16,14); writeln('|2 -> Zurück ins Menu |'); cursorto(16,15); writeln('|==========================================|'); readln(case2_2_1);
case case2_2_1 of 1 : begin lose := lose - 1; kapital := kapital + 7; goto menu end;
2 : goto menu; end; end;
4 : begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(60,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('Lose : ',lose:5:0,' |'); writeln('==============================================================================='); writeln;writeln;
assignfile(save, 'save.txt'); rewrite(save); writeln(save, kapital:5:2); writeln(save, lose:5:0);
close(save); cursorto(32,13); writeln('Gespeichert'); cursorto(32,15); writeln('Drücke Enter'); readln; goto menu; end;
5: begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(60,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('Lose : ',lose:5:0,' |'); writeln('==============================================================================='); writeln;writeln;
cursorto(16,8); writeln('|==========================================|'); cursorto(16,9); writeln('| Laden ? |'); cursorto(16,10); writeln('\##########################################/'); cursorto(16,11); writeln('/##########################################\'); cursorto(16,12); writeln('|1 -> Laden |'); cursorto(16,13); writeln('|------------------------------------------|'); cursorto(16,14); writeln('|2 -> Zurück ins Menu |'); cursorto(16,15); writeln('|==========================================|'); readln(case2_5_1);
case case2_5_1 of 1 : begin writeln('Noch in der Arbeit'); writeln('Drücke Enter'); readln; goto menu; end;
2 : goto menu; end; end;
6 : begin
ClrScr; writeln('==============================================================================='); cursorto(14,1); Writeln('::::::::::::::Sicherer Lotto Generator::::::::::::::'); writeln('==============================================================================='); cursorto(60,3); writeln('| Geld : ',kapital:5:2); cursorto(0,3); writeln('Lose : ',lose:5:0,' |'); writeln('==============================================================================='); writeln;writeln;
cursorto(16,8); writeln('|==========================================|'); cursorto(16,9); writeln('| Beenden ? |'); cursorto(16,10); writeln('\##########################################/'); cursorto(16,11); writeln('/##########################################\'); cursorto(16,12); writeln('|1 -> Ja (Verlassen) |'); cursorto(16,13); writeln('|------------------------------------------|'); cursorto(16,14); writeln('|2 -> Zurück ins Menu |'); cursorto(16,15); writeln('|==========================================|'); writeln;writeln;writeln;writeln; writeln('Made by'); writeln(' Jethacker'); cursorto (0,17); readln(case2_6_1);
case case2_6_1 of 1 : donewincrt;
2 : goto menu; end; end;
end; end; end; end. |
|
|
Jethacker
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: So 23.01.05 01:10
Köönte mir vileicht noma jemand helfen?
Also ich hab ein prob
zb bei meiner ersten case anfrage.
Dort frage ich den schwirigkeitsgrad ab, wahl zwischen 1 und 3 aber ich möchte da noch einfügen das man dort, falls man ausversehene 4 eingibt zurück beordert wird und nochmal wählen muss zwischen 1-3 danke
und gibt es sowas wie nen wait_25 befehl bei nilipas?
das man halt 25 ms auf den nächsten text warten muss?
und gibt es auch nen befehl für musik einfügen(mp3)?
|
|
JayEff
      
Beiträge: 2971
Windows Vista Ultimate
D7 Enterprise
|
Verfasst: So 23.01.05 17:47
"wait befehl": sleep(miliseconds);
case abfrage: packs in eine While schleife wie ich schon gesagt habe!!!!! (lies doch *Schimpf*)
Delphi-Quelltext 1: 2: 3: 4: 5:
| while auswahl > 3 do begin writeln('falsche eingabe!'); readln(auswahl); end; |
_________________ >+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
|
|
|