changed the file structure

This commit is contained in:
Sage The DM 2024-08-27 10:41:17 +02:00
parent cd81159162
commit b1c3582880
391 changed files with 675 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}

View 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).

Binary file not shown.

View file

@ -0,0 +1,42 @@
import java.util.Random;
import java.util.Scanner;
public class App {
static Scanner scan = new Scanner(System.in);
static Random random = new Random();
public static void main(String[] args) {
int numberOfTries = 0;
int maxNumber = 100;
int randomNumber = random.nextInt(maxNumber) + 1;
int userinput = 0;
System.out.println("Number for the dev to check if the games is working: " + randomNumber);
System.out.println("Welcome to the Number Guessing Game!");
System.out.println("I have selected a random number between " + 0 + " and " + maxNumber + ".");
System.out.println("Try to guess the number.");
while (true) {
numberOfTries++;
System.out.println(numberOfTries + ". Try");
userinput = scan.nextInt();
if (randomNumber > userinput) {
System.out.println("Lmao no the number is bigger");
} else if (randomNumber == userinput) {
System.out.println("You got the right number my brother");
System.out.println("You only needed " + numberOfTries + " tries");
break;
} else {
System.out.println("No the number is smaller");
}
}
if (numberOfTries == 1) {
System.out.println("No offense but are you sure you didn't cheat?");
}
scan.close();
}
}

View file

@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}

View 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).

Binary file not shown.

View file

@ -0,0 +1,43 @@
import java.util.Random;
import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Random random = new Random();
int minRange = -1000;
int maxRange = 1000;
int randomNumber = random.nextInt(maxRange - minRange + 1) + minRange;
int numberOfTries = 0;
int inputNumber;
// System.out.println("Number for the dev to check if the games is working: " +
// randomNumber);
System.out.println("Welcome to the Number Guessing Game!");
System.out.println("I have selected a random number between " + minRange + " and " + maxRange + ".");
System.out.println("Try to guess the number.");
do {
System.out.print("Enter your guess: ");
inputNumber = scanner.nextInt();
numberOfTries++;
if (inputNumber < randomNumber) {
System.out.println("The number is higher. Try again. (" + numberOfTries + " Try)");
} else if (inputNumber > randomNumber) {
System.out.println("The number is lower. Try again. (" + numberOfTries + " Try)");
} else {
System.out.println(
"Congratulations! You guessed the number " + randomNumber + " in " + numberOfTries + " tries.");
}
} while (inputNumber != randomNumber);
if (numberOfTries == 1) {
System.out.println("No offense but are you sure you didn't cheat?");
}
scanner.close();
}
}