2015-09-07 11:44:36 -06:00
|
|
|
// containersindepth/Prediction.java
|
2015-06-15 17:47:35 -07:00
|
|
|
// Predicting the weather with groundhogs.
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
public class Prediction {
|
|
|
|
private static Random rand = new Random(47);
|
|
|
|
private boolean shadow = rand.nextDouble() > 0.5;
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
if(shadow)
|
|
|
|
return "Six more weeks of Winter!";
|
|
|
|
else
|
|
|
|
return "Early Spring!";
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
}
|