Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

75%
+4 −0
Q&A Algorithmically generating the grid formed by the vertices of a dodecahedron (Hunt The Wumpus)

Here is an animation of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the e...

posted 2y ago by r~~‭  ·  edited 2y ago by Alexei‭

Answer
#4: Post edited by user avatar Alexei‭ · 2022-03-02T06:15:14Z (about 2 years ago)
removed useless reference to another user
  • [Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation (Olin Lathrop, avert your eyes!) of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.
  • There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):
  • ```python
  • edges = []
  • for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  • for side in [0, 2]:
  • a0 = {x: 0, y: 0, z: side}
  • a1 = {x: 1, y: 0, z: side}
  • a2 = {x: 2, y: 0, z: side}
  • b0 = {x: 0, y: 2, z: side}
  • b1 = {x: 1, y: 2, z: side}
  • b2 = {x: 2, y: 2, z: side}
  • edges.extend([(a0, a1), (a1, a2), (b0, b1), (b1, b2), (a1, b1)])
  • ```
  • [Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.
  • There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):
  • ```python
  • edges = []
  • for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  • for side in [0, 2]:
  • a0 = {x: 0, y: 0, z: side}
  • a1 = {x: 1, y: 0, z: side}
  • a2 = {x: 2, y: 0, z: side}
  • b0 = {x: 0, y: 2, z: side}
  • b1 = {x: 1, y: 2, z: side}
  • b2 = {x: 2, y: 2, z: side}
  • edges.extend([(a0, a1), (a1, a2), (b0, b1), (b1, b2), (a1, b1)])
  • ```
#3: Post edited by user avatar r~~‭ · 2022-03-01T23:25:24Z (about 2 years ago)
  • [Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation (Olin Lathrop, avert your eyes!) of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.
  • There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):
  • ```python
  • edges = []
  • for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  • for side in [0, 2]:
  • l0 = {x: 0, y: 0, z: side}
  • l1 = {x: 1, y: 0, z: side}
  • l2 = {x: 2, y: 0, z: side}
  • r0 = {x: 0, y: 2, z: side}
  • r1 = {x: 1, y: 2, z: side}
  • r2 = {x: 2, y: 2, z: side}
  • edges.extend([(l0, l1), (l1, l2), (r0, r1), (r1, r2), (l1, r1)])
  • ```
  • [Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation (Olin Lathrop, avert your eyes!) of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.
  • There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):
  • ```python
  • edges = []
  • for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  • for side in [0, 2]:
  • a0 = {x: 0, y: 0, z: side}
  • a1 = {x: 1, y: 0, z: side}
  • a2 = {x: 2, y: 0, z: side}
  • b0 = {x: 0, y: 2, z: side}
  • b1 = {x: 1, y: 2, z: side}
  • b2 = {x: 2, y: 2, z: side}
  • edges.extend([(a0, a1), (a1, a2), (b0, b1), (b1, b2), (a1, b1)])
  • ```
#2: Post edited by user avatar r~~‭ · 2022-03-01T23:22:35Z (about 2 years ago)
  • [Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation (Olin Lathrop, avert your eyes!) of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.
  • There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):
  • ```python
  • edges = []
  • for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  • for side in [0, 2]:
  • v01 = {x: 0, y: 0, z: side}
  • v02 = {x: 1, y: 0, z: side}
  • v03 = {x: 2, y: 0, z: side}
  • v11 = {x: 0, y: 2, z: side}
  • v12 = {x: 1, y: 2, z: side}
  • v13 = {x: 2, y: 2, z: side}
  • edges.extend([(v01, v02), (v02, v03), (v11, v12), (v12, v13), (v01, v11)])
  • ```
  • [Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation (Olin Lathrop, avert your eyes!) of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.
  • There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):
  • ```python
  • edges = []
  • for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  • for side in [0, 2]:
  • l0 = {x: 0, y: 0, z: side}
  • l1 = {x: 1, y: 0, z: side}
  • l2 = {x: 2, y: 0, z: side}
  • r0 = {x: 0, y: 2, z: side}
  • r1 = {x: 1, y: 2, z: side}
  • r2 = {x: 2, y: 2, z: side}
  • edges.extend([(l0, l1), (l1, l2), (r0, r1), (r1, r2), (l1, r1)])
  • ```
#1: Initial revision by user avatar r~~‭ · 2022-03-01T22:25:43Z (about 2 years ago)
[Here](https://i.pinimg.com/originals/b6/c9/65/b6c9653dcd8f47402bede44e1bc09398.gif) is an animation (Olin Lathrop, avert your eyes!) of a cube with faces subdivided into two rectangles, morphing into a rhombic dodecahedron, with the Platonic dodecahedron as an intermediate state. This demonstrates that the edge graph of the Platonic dodecahedron is the same as the edge graph of the subdivided cube.

There are probably a lot of ways you could generate this graph algorithmically, but here's one (in Python rather than pseudocode, but Python is pretty close to pseudocode):

```python
edges = []
for x, y, z in [(0, 1, 2), (1, 2, 0), (2, 0, 1)]:
  for side in [0, 2]:
    v01 = {x: 0, y: 0, z: side}
    v02 = {x: 1, y: 0, z: side}
    v03 = {x: 2, y: 0, z: side}
    v11 = {x: 0, y: 2, z: side}
    v12 = {x: 1, y: 2, z: side}
    v13 = {x: 2, y: 2, z: side}
    edges.extend([(v01, v02), (v02, v03), (v11, v12), (v12, v13), (v01, v11)])
```