-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathFox.java
More file actions
executable file
·66 lines (66 loc) · 1.62 KB
/
Copy pathFox.java
File metadata and controls
executable file
·66 lines (66 loc) · 1.62 KB
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
59
60
61
62
63
64
65
66
import java.io.InputStream;
/**
* Write a description of class Fox here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Fox extends Animal implements Roamable
{
public String toy;
public String food;
public Fox(String name, String desc)
{
super(desc, name);
}
public String play()
{
if(Math.random() > .3 && Math.random() < .5)
{
toy = "ball";
}
else if(Math.random() < .3)
{
toy = "... oh god I hope that's not a body part.";
}
else
{
toy = "a suspicious item";
}
return " The fox plays with " + toy;
}
public String eat()
{
if(Math.random() > .3 && Math.random() < .6)
{
food = " finally catches a small child and drags it back to its den";
}
else if(Math.random() < .3)
{
food = " seems to be chewing on some kind of leftovers";
}
else
{
food = " is eating a large juicy looking steak";
}
return "The fox" + food;
}
public String sleep()
{
return "The fox never sleeps, it is eternal, it is all knowing..."
+ " It fell over form exhaustion.";
}
public String makeNoise()
{
// import audio file of that norwegian song.
return "*Fox Noise*";
}
public String roam()
{
return "The fox rushes about looking for easy prey and shiny objects";
}
public String move()
{
return "The fox sprints back and forth for seemingly no apparent reason.";
}
}