Hallo, ich habe diesen Batch spiel programmiert (Code unten), aber es funktioniert noch nicht ganz:
kann mir jemand ein Modul schreiben, das die werte der Aktien jeden tag um bis zu 100 verändert, je nach Zufall (Sprungmarke :tagse)?
kann mir jemand ein Modul schreiben, das die werte der Aktien jeden tag um bis zu 100 verändert, je nach Zufall (Sprungmarke :tagse)?
Code:
@echo off
title MONYGAME
echo.
echo M O N Y G A M E
echo.
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo Wie heisst ihre Firma?
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set /p name=_
goto gewerbeschein
:gewerbeschein
cls
set t=-closed-
set /a tag=1
set geld=200000
set schulden=0
set att1=0
set att2=0
set att3=0
set att4=0
set att5=0
set att6=0
set att7=0
set att8=0
set att9=0
set wtt1=22000
set wtt2=19000
set wtt3=21000
set wtt4=24000
set wtt5=25000
echo.
echo.
echo ###################################################
echo.
echo Gewerbeschein feur die Firma
echo %name%
echo.
echo Startkapital: 200.000 $
echo.
echo ###################################################
echo.
echo Dreucken sie eine Taste, um das Spiel zu Starten
pause>nul
:hauptmenue
cls
echo.
echo.
echo ###################################################
echo.
echo 1) Spiel starten Mony
echo 2) Credits -
echo 3) Spiel verlassen Game
echo.
echo ###################################################
echo.
set /p hm=
if %hm%==1 goto startgame
if %hm%==2 goto credits
if %hm%==3 goto ausgang
goto hauptmenue
:credits
cls
echo.
echo.
echo ###################################################
echo.
echo Monygame
echo.
echo Ein spiel von Delta007
echo.
echo ###################################################
echo.
ping localhost>nul
ping localhost>nul
ping localhost>nul
goto hauptmenue
:ausgang
cls
echo.
echo.
echo.
echo.
echo ! Wollen sie MONYGAME wirklich schliessen? !
echo.
set /p antwa= J/N
if %antwa%==J exit
if %antwa%==j exit
if %antwa%==N goto hauptmenue
if %antwa%==n goto hauptmenue
goto ausgang
:startgame
cls
echo.
echo.
echo.
echo M O N Y G A M E
echo.
echo GELD
echo MACHT
echo BEZIEHUNGEN
echo.
ping localhost>nul
goto screen
:screen
cls
echo.
echo.
echo.
echo Datum: %date% Geld: %geld% $ Kredite: %schulden% $
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo Was wollen sie machen? Tag %tag%
echo.
echo 1) Aktien verkaufen %t%
echo 2) Aktien kaufen
echo 3) Kredit aufnehmen/tilgen
echo 4) Tag beenden
echo.
set /p aktion=
if %aktion%=="" goto screen
if %aktion%==1 goto verkaufen
if %aktion%==2 goto kaufen
if %aktion%==3 goto kredit
if %aktion%==4 goto tagse
goto screen
:tagse
set /a tag=%tag%+1
goto screen
:kredit
echo.
echo.
echo Wieviel Geld wollen sie sich leien?
set /p krme=
set geld=%geld%+%krme%
set schuleden=%schulden%+%krme%
goto screen
:kaufen
set t=-opened-
cls
echo.
echo.
echo.
echo Datum: %date% Geld: %geld% $ Kredite: %schulden% $
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo B O E R S E
echo.
echo.
echo.
echo BESTAND VW %att1% POST %att2% MICROSOFT %att3% SIEMENS %att4% GOOGLE %att5%
echo.
echo WERTE
echo VW %wtt1% $
echo.
echo POST %wtt2% $
echo.
echo MICROSOFT %wtt3% $
echo.
echo SIEMENS %wtt4% $
echo.
echo GOOGLE %wtt5% $
echo.
echo GEBEN SIE "BACK" EIN, UM ZUM MENUE ZU GELANGEN:
echo.
set /p aka= WELCHE AKTIE WOLLEN SIE KAUFEN?
if %aka%==BACK goto screen
if %aka%==Back goto screen
if %aka%==back goto screen
if %aka%==VW goto kvw
if %aka%==POST goto kpo
if %aka%==MICROSOFT goto kmi
if %aka%==SIEMENS goto ksi
if %aka%==GOOGLE goto kgo
goto kaufen
:kvw
set /a att1=%att1%+1
set /a geld=%geld%-%wtt1%
goto kaufen
:kpo
set /a att2=%att2%+1
set /a geld=%geld%-%wtt2%
goto kaufen
:kmi
set /a att3=%att3%+1
set /a geld=%geld%-%wtt3%
goto kaufen
:ksi
set /a att4=%att4%+1
set /a geld=%geld%-%wtt4%
goto kaufen
:kgo
set /a att5=%att5%+1
set /a geld=%geld%-%wtt5%
goto kaufen
:verkaufen
if %t%==-closed- goto screen
cls
echo.
echo.
echo.
echo Datum: %date% Geld: %geld% $ Kredite: %schulden% $
echo.
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo.
echo B O E R S E
echo.
echo.
echo.
echo BESTAND VW %att1% POST %att2% MICROSOFT %att3% SIEMENS %att4% GOOGLE %att5%
echo.
echo WERTE
echo VW %wtt1% $
echo.
echo POST %wtt2% $
echo.
echo MICROSOFT %wtt3% $
echo.
echo SIEMENS %wtt4% $
echo.
echo GOOGLE %wtt5% $
echo.
echo GEBEN SIE "BACK" EIN, UM ZUM MENUE ZU GELANGEN:
echo.
set /p avk= WELCHE AKTIE WOLLEN SIE VERKAUFEN?
if %avk%==BACK goto screen
if %avk%==Back goto screen
if %avk%==back goto screen
if %avk%==VW goto vvw
if %avk%==POST goto vpo
if %avk%==MICROSOFT goto vmi
if %avk%==SIEMENS goto vsi
if %avk%==GOOGLE goto vgo
goto verkaufen
:error2
echo.
echo SIE KOENNEN KEINE DIESER AKTIEN VERKAUFEN!
echo.
ping localhost>nul
goto verkaufen
:vvw
if %att1%==0 goto error2
set /a att1=%att1%-1
set /a geld=%geld%+%wtt1%
goto verkaufen
:vpo
if %att2%==0 goto error2
set /a att2=%att2%-1
set /a geld=%geld%+%wtt2%
goto verkaufen
:vmi
if %att3%==0 goto error2
set /a att3=%att3%-1
set /a geld=%geld%+%wtt3%
goto verkaufen
:vsi
if %att4%==0 goto error2
set /a att4=%att4%-1
set /a geld=%geld%+%wtt4%
goto verkaufen
:vgo
if %att5%==0 goto error2
set /a att5=%att5%-1
set /a geld=%geld%+%wtt5%
goto verkaufen