Skip to content

Commit 4eb84f4

Browse files
committed
Initial Commit
1 parent dc84b7b commit 4eb84f4

14 files changed

+283
-65
lines changed

.gitattributes

-22
This file was deleted.

.gitignore

-43
This file was deleted.

Scr1.java

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
public class Scr1 {
3+
public static void main(String args[]){
4+
System.out.println("Welcome to the game!");
5+
}
6+
}

Scr10.java

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr10 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
while(true){
19+
String input = sc.nextLine();
20+
switch(input){
21+
case "hello": System.out.println("hello there");
22+
break;
23+
case "exit": System.out.println("come again sometime!");
24+
break;
25+
default: System.out.println("what?");
26+
}
27+
}
28+
}
29+
}

Scr11.java

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr11 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
while(true){
19+
String input = sc.nextLine();
20+
switch(input){
21+
case "hello": System.out.println("hello there");
22+
break;
23+
case "exit": System.out.println("come again sometime!");
24+
break;
25+
case "open door": if(location.equals("house")){
26+
location = "lawn";
27+
}
28+
break;
29+
case "eat": if(items[0].equals("apple")){
30+
System.out.println("you eat, and feel more energized.");
31+
items[0] = "apple core";
32+
}
33+
break;
34+
case "look":
35+
switch(location){
36+
case "house": System.out.println("You are in a small wooden house. You can see"
37+
+ " the front door");
38+
case "lawn": System.out.println("You are on a front lawn, a house behind you.");
39+
}
40+
default: System.out.println("what?");
41+
}
42+
}
43+
}
44+
}

Scr12.java

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr12 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
while(true){
19+
String input = sc.nextLine();
20+
switch(input){
21+
case "hello": System.out.println("hello there");
22+
break;
23+
case "exit": System.out.println("come again sometime!");
24+
break;
25+
case "open door": if(location.equals("house")){
26+
location = "lawn";
27+
}
28+
break;
29+
case "look":
30+
switch(location){
31+
case "house": System.out.println("You are in a small wooden house. You can see"
32+
+ " the front door");
33+
case "lawn": System.out.println("You are on a front lawn, a house behind you.");
34+
}
35+
default: System.out.println("what?");
36+
}
37+
}
38+
}
39+
}

Scr2.java

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
public class Scr2 {
3+
public static void main(String args[]){
4+
int x = 12;
5+
System.out.println("Welcome to the game!");
6+
System.out.println("The current time is: " + x + " O'clock");
7+
}
8+
}

Scr3.java

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
public class Scr3 {
3+
public static void main(String args[]){
4+
int x = 12;
5+
boolean isMorning = true;
6+
String location = "house";
7+
System.out.println("Welcome to the game!");
8+
System.out.println("The current time is: " + x + " O'clock");
9+
System.out.println("You are located at: " + location);
10+
System.out.println("Morning: " + isMorning);
11+
}
12+
}

Scr4.java

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
public class Scr4 {
3+
public static void main(String args[]){
4+
String[] items = new String[10];
5+
items[0] = "apple";
6+
int x = 12;
7+
boolean isMorning = true;
8+
String location = "house";
9+
System.out.println("Welcome to the game!");
10+
System.out.println("The current time is: " + x + " O'clock");
11+
System.out.println("You are located at: " + location);
12+
System.out.println("Morning: " + isMorning);
13+
System.out.println("Item 1: "+ items[0]);
14+
}
15+
}

Scr5.java

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr5 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
String input = sc.nextLine();
19+
System.out.println(input);
20+
sc.close();
21+
}
22+
}

Scr6.java

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr6 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
String input = sc.nextLine();
19+
if(input.equals("hello")){
20+
System.out.println("hello there");
21+
}
22+
sc.close();
23+
}
24+
}

Scr7.java

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr7 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
String input = sc.nextLine();
19+
if(input.equals("hello")){
20+
System.out.println("hello there");
21+
} else{
22+
System.out.println("what?");
23+
}
24+
sc.close();
25+
}
26+
}

Scr8.java

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr8 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
String input = sc.nextLine();
19+
if(input.equals("hello")){
20+
System.out.println("hello there");
21+
}else if(input.equals("exit")){
22+
System.out.println("come again sometime!");
23+
} else{
24+
System.out.println("what?");
25+
}
26+
sc.close();
27+
}
28+
}

Scr9.java

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import java.util.Scanner;
2+
3+
4+
public class Scr9 {
5+
public static void main(String args[]){
6+
String[] items = new String[10];
7+
items[0] = "apple";
8+
int x = 12;
9+
boolean isMorning = true;
10+
String location = "house";
11+
Scanner sc = new Scanner(System.in);
12+
System.out.println("Welcome to the game!");
13+
System.out.println("The current time is: " + x + " O'clock");
14+
System.out.println("You are located at: " + location);
15+
System.out.println("Morning: " + isMorning);
16+
System.out.println("Item 1: "+ items[0]);
17+
System.out.println("Enter command");
18+
while(true){
19+
String input = sc.nextLine();
20+
if(input.equals("hello")){
21+
System.out.println("hello there");
22+
}else if(input.equals("exit")){
23+
System.out.println("come again sometime!");
24+
break;
25+
} else{
26+
System.out.println("what?");
27+
}
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)