Skip to content

Commit 2c2c8b2

Browse files
authored
Merge branch 'develop' into exports
2 parents 4eb0a69 + 35bc531 commit 2c2c8b2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/objects/challenges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Broom {
3434
class Witch {
3535
Object pullFromHat() {
3636
double r = Math.random();
37-
if (Math.random() < 0.25) {
37+
if (r < 0.25) {
3838
return new Spell("Ensmallen");
3939
}
4040
else if (r < 0.5) {

src/standard_input_ii/delayed_assignment.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The problem with this is that Java isn't smart enough to know that you always in
1212
void main() {
1313
String name;
1414
while (true) {
15-
String name = IO.readln("What is your name? ");
15+
name = IO.readln("What is your name? ");
1616
if (name.isBlank()) {
1717
IO.println("Name cannot be blank!");
1818
continue;
@@ -31,7 +31,7 @@ To get around this you can either give an explicit default value.
3131
void main() {
3232
String name = null;
3333
while (true) {
34-
String name = IO.readln("What is your name? ");
34+
name = IO.readln("What is your name? ");
3535
if (name.isBlank()) {
3636
IO.println("Name cannot be blank!");
3737
continue;
@@ -52,7 +52,7 @@ to see that the code in the loop will run at least once.
5252
void main() {
5353
String name;
5454
do {
55-
String name = IO.readln("What is your name? ");
55+
name = IO.readln("What is your name? ");
5656
if (name.isBlank()) {
5757
IO.println("Name cannot be blank!");
5858
continue;

src/standard_input_ii/enums.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum StopLight {
3232
void main() {
3333
StopLight color;
3434
while (true) {
35-
String colorString = IO.readln("What color was the stoplight? ");
35+
String colorString = IO.readln("What color was the stoplight? ");
3636
try {
3737
color = StopLight.valueOf(colorString);
3838
} catch (RuntimeException e) {

src/time/instant.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void main() {
1313
}
1414
```
1515

16-
But if you happen to know a number milliseconds after January 1, 1970 UTC[^epoch] you
16+
But if you happen to know the number of milliseconds since January 1, 1970 0:00 UTC[^epoch], you
1717
can get an `Instant` which represents that point in time with `Instant.ofEpochMilli`.
1818

1919
```java

0 commit comments

Comments
 (0)