13.8.2024 - Steiner Preparation
This commit is contained in:
parent
9d8b690096
commit
cd81159162
12 changed files with 1041 additions and 27 deletions
7
Code/Age/.vscode/settings.json
vendored
Normal file
7
Code/Age/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"java.project.sourcePaths": ["src"],
|
||||||
|
"java.project.outputPath": "bin",
|
||||||
|
"java.project.referencedLibraries": [
|
||||||
|
"lib/**/*.jar"
|
||||||
|
]
|
||||||
|
}
|
18
Code/Age/README.md
Normal file
18
Code/Age/README.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
|
||||||
|
|
||||||
|
## Folder Structure
|
||||||
|
|
||||||
|
The workspace contains two folders by default, where:
|
||||||
|
|
||||||
|
- `src`: the folder to maintain sources
|
||||||
|
- `lib`: the folder to maintain dependencies
|
||||||
|
|
||||||
|
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
|
||||||
|
|
||||||
|
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
|
||||||
|
|
||||||
|
## Dependency Management
|
||||||
|
|
||||||
|
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
|
BIN
Code/Age/bin/App.class
Normal file
BIN
Code/Age/bin/App.class
Normal file
Binary file not shown.
BIN
Code/Age/src/App.class
Normal file
BIN
Code/Age/src/App.class
Normal file
Binary file not shown.
30
Code/Age/src/App.java
Normal file
30
Code/Age/src/App.java
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class App {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
double ageParent = 0;
|
||||||
|
double ageChild = 0;
|
||||||
|
|
||||||
|
ageParent = getInput("Parent");
|
||||||
|
ageChild = getInput("Child");
|
||||||
|
|
||||||
|
System.out.println("Calculating when the child is half the age of the parent");
|
||||||
|
|
||||||
|
for (double x = 0; x >= 0; x++) {
|
||||||
|
if ((ageParent + x) / 2 == ageChild + x) {
|
||||||
|
ageChild += x;
|
||||||
|
ageParent += x;
|
||||||
|
System.out.println("age of the child: " + ageChild);
|
||||||
|
System.out.println("age of the parent: " + ageParent);
|
||||||
|
System.out.println("That will be in " + x + " years");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getInput(String x) {
|
||||||
|
Scanner scan = new Scanner(System.in);
|
||||||
|
System.out.print("Enter the age of " + x + ": ");
|
||||||
|
return scan.nextInt();
|
||||||
|
}
|
||||||
|
}
|
7
Code/codinGame/.vscode/settings.json
vendored
Normal file
7
Code/codinGame/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"java.project.sourcePaths": ["src"],
|
||||||
|
"java.project.outputPath": "bin",
|
||||||
|
"java.project.referencedLibraries": [
|
||||||
|
"lib/**/*.jar"
|
||||||
|
]
|
||||||
|
}
|
18
Code/codinGame/README.md
Normal file
18
Code/codinGame/README.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
|
||||||
|
|
||||||
|
## Folder Structure
|
||||||
|
|
||||||
|
The workspace contains two folders by default, where:
|
||||||
|
|
||||||
|
- `src`: the folder to maintain sources
|
||||||
|
- `lib`: the folder to maintain dependencies
|
||||||
|
|
||||||
|
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
|
||||||
|
|
||||||
|
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
|
||||||
|
|
||||||
|
## Dependency Management
|
||||||
|
|
||||||
|
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
|
5
Code/codinGame/src/App.java
Normal file
5
Code/codinGame/src/App.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
public class App {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
System.out.println("Hello, World!");
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
346
Code/gambling/bin/Gambling.pap
Normal file
346
Code/gambling/bin/Gambling.pap
Normal file
|
@ -0,0 +1,346 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FRAME GUID="2FB25471-B62C-4EE6-BD43-F819C095ACF8" FORMAT="0000" APP_VERSION="2.2.0.8" CHECKSUM="3269D5E4C23D27C0">
|
||||||
|
<PROJECT FORMAT="1.00" NAME="Gambling" AUTHOR="lucab" CREATED="2024.08.03 15:08:57" MODIFIED="2024.08.03 15:29:12">
|
||||||
|
<DIAGRAMS>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="0" NAME="Hauptprogramm 1" CREATED="2024.08.03 15:09:03" MODIFIED="2024.08.03 15:20:17">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="5" ROWS="15">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[Hauptprogramm 1]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapInput" FORMAT="1.00" ID="31">
|
||||||
|
<TEXT><![CDATA[How much money do you have?]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="3">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="33">
|
||||||
|
<TEXT><![CDATA[Budget=x;]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="4">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="62">
|
||||||
|
<TEXT><![CDATA[Have fun gambling]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="5">
|
||||||
|
<FIGURE SUBTYPE="PapLoopStart" FORMAT="1.00" ID="54" ASSOCIATE="56">
|
||||||
|
<TEXT><![CDATA[game loop]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="6">
|
||||||
|
<FIGURE SUBTYPE="PapCondition" FORMAT="1.00" ID="4">
|
||||||
|
<TEXT><![CDATA[What Game?]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="6">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="10">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="12">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="64">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="73">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="12">
|
||||||
|
<FIGURE SUBTYPE="PapLoopEnd" FORMAT="1.00" ID="56" ASSOCIATE="54">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="13">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="107">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="14">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="20">
|
||||||
|
<TEXT><![CDATA[coinflip]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="21">
|
||||||
|
<TEXT><![CDATA[Blackjack]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="22">
|
||||||
|
<TEXT><![CDATA[Roulette]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="69">
|
||||||
|
<TEXT><![CDATA[EndGame]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="35">
|
||||||
|
<TEXT><![CDATA[Invalid Input]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="23">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="25">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="27">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="3" ROW="6">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="89">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="3" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="79">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="4" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="92">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="4" ROW="13">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="99">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="61" FROM="33" TO="62" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="5" FROM="4" TO="6" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="7" FROM="6" TO="10" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="9" FROM="6" TO="20" TEXT="1 coinflip" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="11" FROM="10" TO="12" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="63" FROM="62" TO="54" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="15" FROM="10" TO="21" TEXT="2 BlackJack" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="17" FROM="12" TO="22" TEXT="3 Roulette" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="91" FROM="89" TO="4" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="24" FROM="20" TO="23" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="26" FROM="21" TO="25" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="28" FROM="22" TO="27" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="29" FROM="23" TO="25" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="30" FROM="25" TO="27" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="31" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="55" FROM="54" TO="4" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="13" FROM="12" TO="64" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="60" FROM="31" TO="33" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="76" FROM="73" TO="35" TEXT="default" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="96" FROM="92" TO="99" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="78" FROM="35" TO="79" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="65" FROM="64" TO="73" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="68" FROM="64" TO="69" TEXT="0" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="82" FROM="79" TO="89" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="94" FROM="69" TO="92" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="109" FROM="107" TO="2" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="102" FROM="99" TO="107" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="1" NAME="coinflip" CREATED="2024.08.03 15:10:46" MODIFIED="2024.08.03 15:29:12">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="3" ROWS="15">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="30">
|
||||||
|
<TEXT><![CDATA[You won]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="29">
|
||||||
|
<TEXT><![CDATA[Budget+=Bet]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[coinflip]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="4">
|
||||||
|
<TEXT><![CDATA[Implement scanner & randomizer]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="3">
|
||||||
|
<FIGURE SUBTYPE="PapLoopStart" FORMAT="1.00" ID="6" ASSOCIATE="8">
|
||||||
|
<TEXT><![CDATA[while (true)]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="4">
|
||||||
|
<FIGURE SUBTYPE="PapInput" FORMAT="1.00" ID="10">
|
||||||
|
<TEXT><![CDATA[Bet]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="5">
|
||||||
|
<FIGURE SUBTYPE="PapCondition" FORMAT="1.00" ID="12">
|
||||||
|
<TEXT><![CDATA[bet > budget]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="6">
|
||||||
|
<FIGURE SUBTYPE="PapInput" FORMAT="1.00" ID="21">
|
||||||
|
<TEXT><![CDATA[Input: Head or tails]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="25">
|
||||||
|
<TEXT><![CDATA[Calculation: Head or tails]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapCondition" FORMAT="1.00" ID="19">
|
||||||
|
<TEXT><![CDATA[Input == Calculation]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="33">
|
||||||
|
<TEXT><![CDATA[You lost]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="35">
|
||||||
|
<TEXT><![CDATA[Budget-=bet]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="40">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="12">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="37">
|
||||||
|
<TEXT><![CDATA[Printbudget]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="13">
|
||||||
|
<FIGURE SUBTYPE="PapLoopEnd" FORMAT="1.00" ID="8" ASSOCIATE="6">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="14">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="5">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="16">
|
||||||
|
<TEXT><![CDATA[You dont have enough money]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="17">
|
||||||
|
<TEXT><![CDATA[return]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="4" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="5" FROM="4" TO="6" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="9" FROM="8" TO="2" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="7" FROM="6" TO="10" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="11" FROM="10" TO="12" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="13" FROM="12" TO="21" TEXT="no" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="15" FROM="12" TO="16" TEXT="yes" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="18" FROM="16" TO="17" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="20" FROM="19" TO="33" TEXT="no" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="22" FROM="21" TO="25" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="26" FROM="25" TO="19" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="28" FROM="19" TO="30" TEXT="yes" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="32" FROM="30" TO="29" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="34" FROM="33" TO="35" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="41" FROM="40" TO="37" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="38" FROM="37" TO="8" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="36" FROM="35" TO="40" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="42" FROM="29" TO="40" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="2" NAME="Blackjack" CREATED="2024.08.03 15:10:58" MODIFIED="2024.08.03 15:10:58">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="1" ROWS="3">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[Blackjack]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="2" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="3" NAME="Roulette" CREATED="2024.08.03 15:11:08" MODIFIED="2024.08.03 15:11:08">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="1" ROWS="3">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[Roulette]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="2" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
</DIAGRAMS>
|
||||||
|
</PROJECT>
|
||||||
|
</FRAME>
|
|
@ -1,13 +1,19 @@
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class App {
|
public class App {
|
||||||
public static int Budget = 1000;
|
public static int Budget = 0;
|
||||||
|
public static boolean card[][] = new boolean[4][13];
|
||||||
|
public static int turnCount = 0;
|
||||||
|
public static final int MIN_TURNS = 3;
|
||||||
|
public static final int MAX_TURNS = 10;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
initializeBet();
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.println("1. Coinflip, 2. Blackjack, 3. Roulette");
|
System.out.println("1. Coinflip, 2. Blackjack, 3. Roulette");
|
||||||
int input = getInput();
|
int input = getInput("Enter choice: ");
|
||||||
switch (input) {
|
switch (input) {
|
||||||
case 1:
|
case 1:
|
||||||
playCoinflip();
|
playCoinflip();
|
||||||
|
@ -25,27 +31,42 @@ public class App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getInput() {
|
public static void printRules() {
|
||||||
|
System.out.println("Welcome to Blackjack!");
|
||||||
|
System.out.println("Rules:");
|
||||||
|
System.out.println("1. The goal is to get as close to 21 without exceeding it.");
|
||||||
|
System.out.println("2. Aces can be 1 or 11, face cards are worth 10, and other cards are worth their number.");
|
||||||
|
System.out.println("3. You start by placing a bet before receiving your first two cards.");
|
||||||
|
System.out.println("4. Options:");
|
||||||
|
System.out.println(" - Hit: Draw another card.");
|
||||||
|
System.out.println(" - Stand: Keep your current hand.");
|
||||||
|
System.out.println(" - Double Down: Double your bet and receive one more card.");
|
||||||
|
System.out.println(" - Split: If you have two cards of the same value, split them into two hands.");
|
||||||
|
System.out.println("5. The dealer will draw cards until they have at least 17 points.");
|
||||||
|
System.out.println("6. Cards will be reshuffled after 3-10 turns.");
|
||||||
|
System.out.println("Good luck!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getInput(String text) {
|
||||||
Scanner scan = new Scanner(System.in);
|
Scanner scan = new Scanner(System.in);
|
||||||
System.out.print("Enter your choice: ");
|
System.out.print(text);
|
||||||
return scan.nextInt();
|
return scan.nextInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void playCoinflip() {
|
public static void initializeBet() {
|
||||||
Scanner scan = new Scanner(System.in);
|
Budget = getInput("With how much money do you want to play? ");
|
||||||
Random random = new Random();
|
printBudget();
|
||||||
while (true) {
|
|
||||||
System.out.print("Enter your bet: ");
|
|
||||||
int bet = scan.nextInt();
|
|
||||||
if (bet > Budget) {
|
|
||||||
System.out.println("You don't have enough money.");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.print("Enter 1 for heads or 2 for tails: ");
|
public static void playCoinflip() {
|
||||||
int choice = scan.nextInt();
|
Random random = new Random();
|
||||||
|
while (true) {
|
||||||
|
int bet = enterBet();
|
||||||
|
int choice = getInput("Enter 1 for heads or 2 for tails (0 to stop playing): ");
|
||||||
int result = random.nextInt(2) + 1;
|
int result = random.nextInt(2) + 1;
|
||||||
|
if (choice == 0) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
if (choice == result) {
|
if (choice == result) {
|
||||||
Budget += bet;
|
Budget += bet;
|
||||||
System.out.println("You won!");
|
System.out.println("You won!");
|
||||||
|
@ -56,22 +77,238 @@ public class App {
|
||||||
printBudget();
|
printBudget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void playBlackjack() {
|
public static void playBlackjack() {
|
||||||
// Placeholder for Blackjack game logic
|
ArrayList<Integer> playerHands = new ArrayList<>();
|
||||||
System.out.println("Blackjack game coming soon...");
|
ArrayList<Integer> playerAceCounts = new ArrayList<>();
|
||||||
// Update budget here based on game result
|
ArrayList<Integer> bets = new ArrayList<>();
|
||||||
|
boolean dealerDone = false;
|
||||||
|
|
||||||
|
printRules(); // Print the rules at the start of the Blackjack game
|
||||||
|
shuffleCards(); // Initial shuffle
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
// Reshuffle if needed
|
||||||
|
if (turnCount >= MIN_TURNS && turnCount <= MAX_TURNS
|
||||||
|
&& turnCount % (new Random().nextInt(MAX_TURNS - MIN_TURNS + 1) + MIN_TURNS) == 0) {
|
||||||
|
shuffleCards();
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Starting new hand...");
|
||||||
|
bets.clear();
|
||||||
|
playerHands.clear();
|
||||||
|
playerAceCounts.clear();
|
||||||
|
|
||||||
|
bets.add(enterBet());
|
||||||
|
playerHands.add(getCard());
|
||||||
|
playerHands.set(0, playerHands.get(0) + getCard());
|
||||||
|
playerAceCounts.add(0);
|
||||||
|
|
||||||
|
for (int i = 0; i < playerHands.size(); i++) {
|
||||||
|
boolean handDone = false;
|
||||||
|
|
||||||
|
while (!handDone) {
|
||||||
|
System.out.println("Your hand " + (i + 1) + ": " + playerHands.get(i));
|
||||||
|
System.out.println("1. Hit 2. Stand 3. Double Down 4. Split");
|
||||||
|
int choice = getInput("Choose an action: ");
|
||||||
|
|
||||||
|
switch (choice) {
|
||||||
|
case 1: // Hit
|
||||||
|
playerHands.set(i, playerHands.get(i)
|
||||||
|
+ getCardWithAceHandling(playerHands.get(i), playerAceCounts.get(i)));
|
||||||
|
if (playerHands.get(i) > 21) {
|
||||||
|
System.out.println("You busted!");
|
||||||
|
Budget -= bets.get(i);
|
||||||
|
handDone = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2: // Stand
|
||||||
|
handDone = true;
|
||||||
|
break;
|
||||||
|
case 3: // Double Down
|
||||||
|
if (bets.get(i) * 2 <= Budget) {
|
||||||
|
bets.set(i, bets.get(i) * 2);
|
||||||
|
playerHands.set(i, playerHands.get(i)
|
||||||
|
+ getCardWithAceHandling(playerHands.get(i), playerAceCounts.get(i)));
|
||||||
|
if (playerHands.get(i) > 21) {
|
||||||
|
System.out.println("You busted!");
|
||||||
|
Budget -= bets.get(i);
|
||||||
|
}
|
||||||
|
handDone = true;
|
||||||
|
} else {
|
||||||
|
System.out.println("Not enough budget to double down.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4: // Split
|
||||||
|
if (playerHands.size() < 4 && bets.get(i) * 2 <= Budget) {
|
||||||
|
int firstCard = playerHands.get(i) / 2; // Assuming the player has exactly two of the
|
||||||
|
// same card value
|
||||||
|
int secondCard = playerHands.get(i) - firstCard;
|
||||||
|
|
||||||
|
if (firstCard == secondCard) {
|
||||||
|
playerHands.set(i, firstCard + getCard());
|
||||||
|
playerHands.add(secondCard + getCard());
|
||||||
|
playerAceCounts.add(0);
|
||||||
|
bets.add(bets.get(i));
|
||||||
|
Budget -= bets.get(i); // Deduct the additional bet for the split
|
||||||
|
} else {
|
||||||
|
System.out.println("Cannot split non-matching cards.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("Cannot split more hands or not enough budget.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.out.println("Invalid choice.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dealer's turn
|
||||||
|
int dealerHand = getCard();
|
||||||
|
dealerHand += getCard();
|
||||||
|
while (dealerHand < 17) {
|
||||||
|
dealerHand += getCardWithAceHandling(dealerHand, 0);
|
||||||
|
}
|
||||||
|
dealerDone = true;
|
||||||
|
|
||||||
|
// Determine winner
|
||||||
|
for (int i = 0; i < playerHands.size(); i++) {
|
||||||
|
if (playerHands.get(i) <= 21 && dealerHand <= 21) {
|
||||||
|
if (playerHands.get(i) > dealerHand) {
|
||||||
|
System.out.println("Hand " + (i + 1) + " wins!");
|
||||||
|
Budget += bets.get(i);
|
||||||
|
} else if (playerHands.get(i) < dealerHand) {
|
||||||
|
System.out.println("Hand " + (i + 1) + " loses.");
|
||||||
|
Budget -= bets.get(i);
|
||||||
|
} else {
|
||||||
|
System.out.println("Hand " + (i + 1) + " ties.");
|
||||||
|
}
|
||||||
|
} else if (dealerHand > 21) {
|
||||||
|
System.out.println("Dealer busted! Hand " + (i + 1) + " wins!");
|
||||||
|
Budget += bets.get(i);
|
||||||
|
} else if (playerHands.get(i) > 21) {
|
||||||
|
System.out.println("Hand " + (i + 1) + " busted.");
|
||||||
|
Budget -= bets.get(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
turnCount++;
|
||||||
printBudget();
|
printBudget();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void shuffleCards() {
|
||||||
|
for (int x = 0; x < 4; x++) {
|
||||||
|
for (int y = 0; y < 13; y++) {
|
||||||
|
card[x][y] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("Cards shuffling...");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getCard() {
|
||||||
|
Random random = new Random();
|
||||||
|
int cardValue = 0;
|
||||||
|
|
||||||
|
do {
|
||||||
|
int number = random.nextInt(13);
|
||||||
|
int symbol = random.nextInt(4);
|
||||||
|
|
||||||
|
if (card[symbol][number]) {
|
||||||
|
card[symbol][number] = false;
|
||||||
|
printCard(number, symbol);
|
||||||
|
|
||||||
|
if (number == 0) { // Ace
|
||||||
|
return 11;
|
||||||
|
} else if (number >= 10) { // Jack, Queen, King
|
||||||
|
return 10;
|
||||||
|
} else { // Number cards (2-10)
|
||||||
|
return number + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getCardWithAceHandling(int currentHand, int aceCount) {
|
||||||
|
int cardValue = getCard();
|
||||||
|
currentHand += cardValue;
|
||||||
|
|
||||||
|
if (cardValue == 11) {
|
||||||
|
aceCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (currentHand > 21 && aceCount > 0) {
|
||||||
|
currentHand -= 10;
|
||||||
|
aceCount--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return currentHand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printCard(int card, int symbol) {
|
||||||
|
String displayNumber;
|
||||||
|
char displaySymbol;
|
||||||
|
switch (symbol) {
|
||||||
|
case 0:
|
||||||
|
displaySymbol = '\u2665'; // Hearts
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
displaySymbol = '\u2666'; // Diamonds
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
displaySymbol = '\u2663'; // Clubs
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
displaySymbol = '\u2660'; // Spades
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.out.println("Error");
|
||||||
|
displaySymbol = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (card) {
|
||||||
|
case 0:
|
||||||
|
displayNumber = "A";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
displayNumber = "J";
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
displayNumber = "Q";
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
displayNumber = "K";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
displayNumber = String.valueOf(card + 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
System.out.println("----");
|
||||||
|
System.out.println("|" + displaySymbol + displayNumber + "|");
|
||||||
|
System.out.println("----");
|
||||||
|
}
|
||||||
|
|
||||||
public static void playRoulette() {
|
public static void playRoulette() {
|
||||||
// Placeholder for Roulette game logic
|
|
||||||
System.out.println("Roulette game coming soon...");
|
System.out.println("Roulette game coming soon...");
|
||||||
// Update budget here based on game result
|
|
||||||
printBudget();
|
printBudget();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printBudget() {
|
public static void printBudget() {
|
||||||
System.out.println("Current Budget: $" + Budget);
|
System.out.println("Current Budget: $" + Budget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int enterBet() {
|
||||||
|
while (true) {
|
||||||
|
int bet = getInput("Enter your bet: ");
|
||||||
|
if (bet <= Budget) {
|
||||||
|
return bet;
|
||||||
|
} else {
|
||||||
|
System.out.println("You don't have enough money.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
346
Code/gambling/src/Gambling.pap
Normal file
346
Code/gambling/src/Gambling.pap
Normal file
|
@ -0,0 +1,346 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FRAME GUID="2FB25471-B62C-4EE6-BD43-F819C095ACF8" FORMAT="0000" APP_VERSION="2.2.0.8" CHECKSUM="3269D5E4C23D27C0">
|
||||||
|
<PROJECT FORMAT="1.00" NAME="Gambling" AUTHOR="lucab" CREATED="2024.08.03 15:08:57" MODIFIED="2024.08.03 15:29:12">
|
||||||
|
<DIAGRAMS>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="0" NAME="Hauptprogramm 1" CREATED="2024.08.03 15:09:03" MODIFIED="2024.08.03 15:20:17">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="5" ROWS="15">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[Hauptprogramm 1]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapInput" FORMAT="1.00" ID="31">
|
||||||
|
<TEXT><![CDATA[How much money do you have?]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="3">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="33">
|
||||||
|
<TEXT><![CDATA[Budget=x;]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="4">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="62">
|
||||||
|
<TEXT><![CDATA[Have fun gambling]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="5">
|
||||||
|
<FIGURE SUBTYPE="PapLoopStart" FORMAT="1.00" ID="54" ASSOCIATE="56">
|
||||||
|
<TEXT><![CDATA[game loop]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="6">
|
||||||
|
<FIGURE SUBTYPE="PapCondition" FORMAT="1.00" ID="4">
|
||||||
|
<TEXT><![CDATA[What Game?]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="6">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="10">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="12">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="64">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="73">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="12">
|
||||||
|
<FIGURE SUBTYPE="PapLoopEnd" FORMAT="1.00" ID="56" ASSOCIATE="54">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="13">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="107">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="14">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="20">
|
||||||
|
<TEXT><![CDATA[coinflip]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="21">
|
||||||
|
<TEXT><![CDATA[Blackjack]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="22">
|
||||||
|
<TEXT><![CDATA[Roulette]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="69">
|
||||||
|
<TEXT><![CDATA[EndGame]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="35">
|
||||||
|
<TEXT><![CDATA[Invalid Input]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="23">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="25">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="27">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="3" ROW="6">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="89">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="3" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="79">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="4" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="92">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="4" ROW="13">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="99">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="61" FROM="33" TO="62" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="5" FROM="4" TO="6" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="7" FROM="6" TO="10" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="9" FROM="6" TO="20" TEXT="1 coinflip" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="11" FROM="10" TO="12" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="63" FROM="62" TO="54" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="15" FROM="10" TO="21" TEXT="2 BlackJack" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="17" FROM="12" TO="22" TEXT="3 Roulette" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="91" FROM="89" TO="4" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="24" FROM="20" TO="23" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="26" FROM="21" TO="25" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="28" FROM="22" TO="27" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="29" FROM="23" TO="25" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="30" FROM="25" TO="27" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="31" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="55" FROM="54" TO="4" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="13" FROM="12" TO="64" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="60" FROM="31" TO="33" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="76" FROM="73" TO="35" TEXT="default" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="96" FROM="92" TO="99" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="78" FROM="35" TO="79" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="65" FROM="64" TO="73" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="68" FROM="64" TO="69" TEXT="0" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="82" FROM="79" TO="89" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="94" FROM="69" TO="92" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="109" FROM="107" TO="2" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="102" FROM="99" TO="107" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="1" NAME="coinflip" CREATED="2024.08.03 15:10:46" MODIFIED="2024.08.03 15:29:12">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="3" ROWS="15">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="30">
|
||||||
|
<TEXT><![CDATA[You won]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="29">
|
||||||
|
<TEXT><![CDATA[Budget+=Bet]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[coinflip]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="4">
|
||||||
|
<TEXT><![CDATA[Implement scanner & randomizer]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="3">
|
||||||
|
<FIGURE SUBTYPE="PapLoopStart" FORMAT="1.00" ID="6" ASSOCIATE="8">
|
||||||
|
<TEXT><![CDATA[while (true)]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="4">
|
||||||
|
<FIGURE SUBTYPE="PapInput" FORMAT="1.00" ID="10">
|
||||||
|
<TEXT><![CDATA[Bet]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="5">
|
||||||
|
<FIGURE SUBTYPE="PapCondition" FORMAT="1.00" ID="12">
|
||||||
|
<TEXT><![CDATA[bet > budget]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="6">
|
||||||
|
<FIGURE SUBTYPE="PapInput" FORMAT="1.00" ID="21">
|
||||||
|
<TEXT><![CDATA[Input: Head or tails]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="7">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="25">
|
||||||
|
<TEXT><![CDATA[Calculation: Head or tails]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapCondition" FORMAT="1.00" ID="19">
|
||||||
|
<TEXT><![CDATA[Input == Calculation]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="9">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="33">
|
||||||
|
<TEXT><![CDATA[You lost]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="10">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="35">
|
||||||
|
<TEXT><![CDATA[Budget-=bet]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="11">
|
||||||
|
<FIGURE SUBTYPE="PapConnector" FORMAT="1.00" ID="40">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="12">
|
||||||
|
<FIGURE SUBTYPE="PapModule" FORMAT="1.00" ID="37">
|
||||||
|
<TEXT><![CDATA[Printbudget]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="13">
|
||||||
|
<FIGURE SUBTYPE="PapLoopEnd" FORMAT="1.00" ID="8" ASSOCIATE="6">
|
||||||
|
<TEXT><![CDATA[]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="1" ROW="14">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="5">
|
||||||
|
<FIGURE SUBTYPE="PapOutput" FORMAT="1.00" ID="16">
|
||||||
|
<TEXT><![CDATA[You dont have enough money]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="2" ROW="8">
|
||||||
|
<FIGURE SUBTYPE="PapActivity" FORMAT="1.00" ID="17">
|
||||||
|
<TEXT><![CDATA[return]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="4" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="5" FROM="4" TO="6" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="9" FROM="8" TO="2" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="7" FROM="6" TO="10" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="11" FROM="10" TO="12" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="13" FROM="12" TO="21" TEXT="no" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="15" FROM="12" TO="16" TEXT="yes" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="18" FROM="16" TO="17" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="20" FROM="19" TO="33" TEXT="no" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="22" FROM="21" TO="25" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="26" FROM="25" TO="19" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="28" FROM="19" TO="30" TEXT="yes" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="32" FROM="30" TO="29" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="34" FROM="33" TO="35" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="41" FROM="40" TO="37" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="38" FROM="37" TO="8" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="36" FROM="35" TO="40" TEXT="" />
|
||||||
|
<CONNECTION FORMAT="1.00" ID="42" FROM="29" TO="40" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="2" NAME="Blackjack" CREATED="2024.08.03 15:10:58" MODIFIED="2024.08.03 15:10:58">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="1" ROWS="3">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[Blackjack]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="2" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
<DIAGRAM FORMAT="1.00" ID="3" NAME="Roulette" CREATED="2024.08.03 15:11:08" MODIFIED="2024.08.03 15:11:08">
|
||||||
|
<LAYOUT FORMAT="1.00" COLUMNS="1" ROWS="3">
|
||||||
|
<ENTRIES>
|
||||||
|
<ENTRY COLUMN="0" ROW="0" ANCHOR="True">
|
||||||
|
<FIGURE SUBTYPE="PapTitle" FORMAT="1.00" ID="0">
|
||||||
|
<TEXT><![CDATA[Roulette]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="1">
|
||||||
|
<FIGURE SUBTYPE="PapStart" FORMAT="1.00" ID="1">
|
||||||
|
<TEXT><![CDATA[Start]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
<ENTRY COLUMN="0" ROW="2">
|
||||||
|
<FIGURE SUBTYPE="PapEnd" FORMAT="1.00" ID="2">
|
||||||
|
<TEXT><![CDATA[Ende]]></TEXT>
|
||||||
|
</FIGURE>
|
||||||
|
</ENTRY>
|
||||||
|
</ENTRIES>
|
||||||
|
</LAYOUT>
|
||||||
|
<CONNECTIONS>
|
||||||
|
<CONNECTION FORMAT="1.00" ID="3" FROM="1" TO="2" TEXT="" />
|
||||||
|
</CONNECTIONS>
|
||||||
|
</DIAGRAM>
|
||||||
|
</DIAGRAMS>
|
||||||
|
</PROJECT>
|
||||||
|
</FRAME>
|
Loading…
Reference in a new issue