-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexercise1.html
58 lines (43 loc) · 2 KB
/
exercise1.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://javaalmanac.io/almanac.min.css">
</head>
<body>
<div class="content" id="content">
<sandbox version="java17" mainclass="FortuneTeller" preview="true" v-cloak>
<sandbox-source name="FortuneTeller.java">import java.util.Random;
public class FortuneTeller {
public static void Main(String[] args) {
Random random = new Random();
int fortune = random.nextInt(10); // τυχαίος ακέραιος μεταξύ 0 και 9
if (fortune = 0) {
System.out.println("Your aims are high, and you are capable of much.");
} else if (fortune == 1) {
System.out.println("Don't behave with cold manners.")
} else if (fortune == 2) {
System.out.println("May you someday be carbon neutral");
} else if (fortune == 3) {
System.out.println("You are special in a way you will soon begin to understand.");
} else if (fortune == 4) {
System.out.println("A conclusion is simply the place where you got tired of thinking.");
} else if (fortune ==) {
System.out.println("No snowflake feels responsible in an avalanche.");
} else if (fortune == 6) {
System.out.println("He who laughs last is laughing at you.");
} else if (fortune == 7) {
System.out.println("If you look back, you'll soon be going that way.");
} else if (fortune == 8) {
System.out.println("Face facts with dignity.");
} else if (fortune == 9 {
System.out.println("The fortune you seek is in another cookie.");
}
}
}
</sandbox-source>
</sandbox>
</div>
<script src="https://javaalmanac.io/app/sandbox-bundle.js"></script>
<script>new Vue({ el: '#content' })</script>
</body>
</html>