|
@@ -107,7 +107,7 @@ const Path = struct {
|
|
const a_paths = [_]Path{
|
|
const a_paths = [_]Path{
|
|
Path{
|
|
Path{
|
|
.from = &a, // from: Archer's Point
|
|
.from = &a, // from: Archer's Point
|
|
- .to = &b, // to: Bridge
|
|
|
|
|
|
+ .to = &b, // to: Bridge
|
|
.dist = 2,
|
|
.dist = 2,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -115,12 +115,12 @@ const a_paths = [_]Path{
|
|
const b_paths = [_]Path{
|
|
const b_paths = [_]Path{
|
|
Path{
|
|
Path{
|
|
.from = &b, // from: Bridge
|
|
.from = &b, // from: Bridge
|
|
- .to = &a, // to: Archer's Point
|
|
|
|
|
|
+ .to = &a, // to: Archer's Point
|
|
.dist = 2,
|
|
.dist = 2,
|
|
},
|
|
},
|
|
Path{
|
|
Path{
|
|
.from = &b, // from: Bridge
|
|
.from = &b, // from: Bridge
|
|
- .to = &d, // to: Dogwood Grove
|
|
|
|
|
|
+ .to = &d, // to: Dogwood Grove
|
|
.dist = 1,
|
|
.dist = 1,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -128,12 +128,12 @@ const b_paths = [_]Path{
|
|
const c_paths = [_]Path{
|
|
const c_paths = [_]Path{
|
|
Path{
|
|
Path{
|
|
.from = &c, // from: Cottage
|
|
.from = &c, // from: Cottage
|
|
- .to = &d, // to: Dogwood Grove
|
|
|
|
|
|
+ .to = &d, // to: Dogwood Grove
|
|
.dist = 3,
|
|
.dist = 3,
|
|
},
|
|
},
|
|
Path{
|
|
Path{
|
|
.from = &c, // from: Cottage
|
|
.from = &c, // from: Cottage
|
|
- .to = &e, // to: East Pond
|
|
|
|
|
|
+ .to = &e, // to: East Pond
|
|
.dist = 2,
|
|
.dist = 2,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -141,17 +141,17 @@ const c_paths = [_]Path{
|
|
const d_paths = [_]Path{
|
|
const d_paths = [_]Path{
|
|
Path{
|
|
Path{
|
|
.from = &d, // from: Dogwood Grove
|
|
.from = &d, // from: Dogwood Grove
|
|
- .to = &b, // to: Bridge
|
|
|
|
|
|
+ .to = &b, // to: Bridge
|
|
.dist = 1,
|
|
.dist = 1,
|
|
},
|
|
},
|
|
Path{
|
|
Path{
|
|
.from = &d, // from: Dogwood Grove
|
|
.from = &d, // from: Dogwood Grove
|
|
- .to = &c, // to: Cottage
|
|
|
|
|
|
+ .to = &c, // to: Cottage
|
|
.dist = 3,
|
|
.dist = 3,
|
|
},
|
|
},
|
|
Path{
|
|
Path{
|
|
.from = &d, // from: Dogwood Grove
|
|
.from = &d, // from: Dogwood Grove
|
|
- .to = &f, // to: Fox Pond
|
|
|
|
|
|
+ .to = &f, // to: Fox Pond
|
|
.dist = 7,
|
|
.dist = 7,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -159,20 +159,20 @@ const d_paths = [_]Path{
|
|
const e_paths = [_]Path{
|
|
const e_paths = [_]Path{
|
|
Path{
|
|
Path{
|
|
.from = &e, // from: East Pond
|
|
.from = &e, // from: East Pond
|
|
- .to = &c, // to: Cottage
|
|
|
|
|
|
+ .to = &c, // to: Cottage
|
|
.dist = 2,
|
|
.dist = 2,
|
|
},
|
|
},
|
|
Path{
|
|
Path{
|
|
.from = &e, // from: East Pond
|
|
.from = &e, // from: East Pond
|
|
- .to = &f, // to: Fox Pond
|
|
|
|
- .dist = 1, // (one-way down a short waterfall!)
|
|
|
|
|
|
+ .to = &f, // to: Fox Pond
|
|
|
|
+ .dist = 1, // (one-way down a short waterfall!)
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
const f_paths = [_]Path{
|
|
const f_paths = [_]Path{
|
|
Path{
|
|
Path{
|
|
.from = &f, // from: Fox Pond
|
|
.from = &f, // from: Fox Pond
|
|
- .to = &d, // to: Dogwood Grove
|
|
|
|
|
|
+ .to = &d, // to: Dogwood Grove
|
|
.dist = 7,
|
|
.dist = 7,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
@@ -355,8 +355,8 @@ pub fn main() void {
|
|
// Here's where the hermit decides where he would like to go. Once
|
|
// Here's where the hermit decides where he would like to go. Once
|
|
// you get the program working, try some different Places on the
|
|
// you get the program working, try some different Places on the
|
|
// map!
|
|
// map!
|
|
- const start = &a; // Archer's Point
|
|
|
|
- const destination = &f; // Fox Pond
|
|
|
|
|
|
+ const start = &a; // Archer's Point
|
|
|
|
+ const destination = &f; // Fox Pond
|
|
|
|
|
|
// Store each Path array as a slice in each Place. As mentioned
|
|
// Store each Path array as a slice in each Place. As mentioned
|
|
// above, we needed to delay making these references to avoid
|
|
// above, we needed to delay making these references to avoid
|