Superior Race Plan (geeked)

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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
 
public class RacePlan {
	private static List<Gear> gearList = new ArrayList<Gear>();
	private static Boolean feelsGood = true;
	private static Boolean feelsBad = false;
 
	public static void main(String[] args) {
		List<Gear> gearList = makeGearList();
		gearList = makeGearList();
		Calendar superiorStartDate = null;
		Calendar leaveDate = null;
		superiorStartDate.set(2011, Calendar.SEPTEMBER, 9);
		leaveDate.set(2011, Calendar.SEPTEMBER, 7);
		if (Calendar.getInstance().before(superiorStartDate)
				&& Calendar.getInstance().after(leaveDate)) {
			packAllGear();
			driveToPacketPickup();
		} else if (Calendar.getInstance().equals(superiorStartDate)) {
			for (float mile = 0; mile <= 102.6; mile += .1) {
				if (isAidStation(mile)) {
					System.out
				        .println("Eat food, fill hydration pack, " + 
                                                   "change clothes/shoes");
				}
				if (mile == 42.8) {
					System.out
					.println("Grab the headlamp " + 
                                                   "and flashlight and  " +
                                                   "have fun running " +
                                                   "through the dark!");
				}
				if (feelsGood) {
					System.out
					.println("Keep putting one foot in " +
                                                   "front of the other!  Enjoy the " +
                                                    "scenery and have fun!");
				}
				if (feelsBad) {
					System.out
					.println("Keep putting one foot in front " +
                                                   "of the other.  Don't quit.  Don't " +
                                                   "every stop till you reach the finish");
				}
			}
			System.out
					.println("The end has come!  Relax, eat, sleep, and go home!");
		}
	}
 
	private static void packAllGear() {
		for (Gear g : gearList) {
			if (!g.isPacked) {
				System.out.println("Pack " + g.getName());
				g.isPacked = true;
			}
		}
	}
 
	private static void driveToPacketPickup() {
		System.out.println("Throw the gear in the van and drive!!!");
	}
 
	private static Boolean isAidStation(float mile) {
		if (mile == 9.3 || mile == 19.4 || mile == 24.3 || mile == 34.2
		    || mile == 42.8 || mile == 50.5 || mile == 58 || mile == 62.2
		    || mile == 71.6 || mile == 77.2 || mile == 84.3 || mile == 90
		    || mile == 95.5) {
			return true;
		}
		return false;
	}
 
	private static List<Gear> makeGearList() {
		List<Gear> gl = new ArrayList<Gear>();
		gl.add(new Gear("CamelBak", false));
		gl.add(new Gear("Toilet Paper", false));
		gl.add(new Gear("Shoes", false));
		gl.add(new Gear("Socks", false));
		gl.add(new Gear("Flashlight", false));
		gl.add(new Gear("Headlamp", false));
		gl.add(new Gear("Shorts", false));
		gl.add(new Gear("Short Sleeve Shirt", false));
		gl.add(new Gear("Long Sleeve Shirt", false));
		gl.add(new Gear("Vaseline", false));
		gl.add(new Gear("Rubbing Alcohol", false));
		gl.add(new Gear("Medical Tape", false));
		gl.add(new Gear("Cotton Balls", false));
		gl.add(new Gear("Gorilla Tape", false));
		gl.add(new Gear("Endurolytes", false));
		gl.add(new Gear("Endurance Aminos", false));
		gl.add(new Gear("Anti-Fatigue Caps", false));
		gl.add(new Gear("Visor", false));
		gl.add(new Gear("Sunglasses", false));
		gl.add(new Gear("Phone Case", false));
		gl.add(new Gear("GPS", false));
		gl.add(new Gear("Bottled Water", false));
		gl.add(new Gear("Powerade", false));
		gl.add(new Gear("Mt. Dew", false));
		gl.add(new Gear("Energy Drinks", false));
		gl.add(new Gear("Snickers", false));
		gl.add(new Gear("Larabar's", false));
		gl.add(new Gear("Granola Bars", false));
		gl.add(new Gear("Cheese Crackers w/Peanut Butter", false));
		gl.add(new Gear("PBJ Sandwiches", false));
		gl.add(new Gear("Trail Mix", false));
		gl.add(new Gear("Extra Batteries", false));
		gl.add(new Gear("Rain Jacket", false));
		gl.add(new Gear("MP3 Player", false));
		return gl;
	}
 
	public static class Gear {
		private String name;
		private Boolean isPacked;
 
		public String getName() {
			return name;
		}
 
		public void setName(String name) {
			this.name = name;
		}
 
		public Boolean getIsPacked() {
			return isPacked;
		}
 
		public void setIsPacked(Boolean isPacked) {
			this.isPacked = isPacked;
		}
 
		public Gear(String name, Boolean isPacked) {
			this.name = name;
			this.isPacked = isPacked;
		}
	}
 
}

3 Responses to “Superior Race Plan (geeked)”

  • eric jp says:

    That is some fine coding work. I especially like how feelsgood and feelsbad are private statics…lol

  • eric jp says:

    Also… I see the woman in the red dress…lol

  • It’s very easy to find out any matter on net as compared
    to books, as I found this piece of writing at this web site.

  • Leave a Reply

    Photo

    Craig

    September 2nd


    Uncategorized