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

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

I am attempting to write a program to simulate Hunt The Wumpus in the K programming language. The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangu...

2 answers  ·  posted 2y ago by Razetime‭  ·  edited 2y ago by Razetime‭

Question shape pseudocode k
#4: Nominated for promotion by user avatar Alexei‭ · 2022-03-13T08:16:48Z (over 2 years ago)
#3: Post edited by user avatar Razetime‭ · 2022-03-02T10:57:05Z (over 2 years ago)
  • I am attempting to write a program to simulate [Hunt The Wumpus](http://rosettacode.org/wiki/Hunt_the_Wumpus) in the [K programming language](https://k.miraheze.org/). The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangular in nature.
  • ![Dodecahedron](https://upload.wikimedia.org/wikipedia/commons/6/6a/Dodecahedron-transparent.gif)
  • The general approach I can find on Rosetta Code is generally a hardcoded list of points, like as follows:
  • ```ada
  • Adjacent_Rooms : constant Rooms :=
  • ((1, 4, 7), (0, 2, 9), (1, 3, 11), (2, 3, 13), (0, 3, 5), (4, 6, 14),
  • (5, 7, 16), (0, 6, 8), (7, 9, 17), (1, 8, 10), (9, 11, 18), (2, 10, 12),
  • (11, 13, 19), (3, 12, 14), (5, 13, 15), (14, 16, 19), (5, 15, 17),
  • (8, 16, 18), (10, 17, 19), (12, 15, 18));
  • ```
  • basically encoding the indices of the points that each point links to. I seek to find out a way to algorithmically generate these points (not necessarily using math), or somehow simulate the grid with an ordinary 1D or 2D array somehow.
  • Since K isn't a popular language, I would appreciate answers in a pseudocode format so I can translate the approach correctly.
  • I am attempting to write a program to simulate [Hunt The Wumpus](http://rosettacode.org/wiki/Hunt_the_Wumpus) in the [K programming language](https://k.miraheze.org/). The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangular in nature.
  • ![Dodecahedron](https://upload.wikimedia.org/wikipedia/commons/e/e0/Dodecahedron.jpg)
  • The general approach I can find on Rosetta Code is generally a hardcoded list of points, like as follows:
  • ```ada
  • Adjacent_Rooms : constant Rooms :=
  • ((1, 4, 7), (0, 2, 9), (1, 3, 11), (2, 3, 13), (0, 3, 5), (4, 6, 14),
  • (5, 7, 16), (0, 6, 8), (7, 9, 17), (1, 8, 10), (9, 11, 18), (2, 10, 12),
  • (11, 13, 19), (3, 12, 14), (5, 13, 15), (14, 16, 19), (5, 15, 17),
  • (8, 16, 18), (10, 17, 19), (12, 15, 18));
  • ```
  • basically encoding the indices of the points that each point links to. I seek to find out a way to algorithmically generate these points (not necessarily using math), or somehow simulate the grid with an ordinary 1D or 2D array somehow.
  • Since K isn't a popular language, I would appreciate answers in a pseudocode format so I can translate the approach correctly.
#2: Post edited by user avatar Alexei‭ · 2022-03-01T18:00:17Z (over 2 years ago)
add/remove tags
#1: Initial revision by user avatar Razetime‭ · 2022-03-01T11:39:57Z (over 2 years ago)
Algorithmically generating the grid formed by the vertices of a dodecahedron (Hunt The Wumpus)
I am attempting to write a program to simulate [Hunt The Wumpus](http://rosettacode.org/wiki/Hunt_the_Wumpus) in the [K programming language](https://k.miraheze.org/). The game requires a grid that is created by the vertices of a Dodecahedron, which is cyclic and triangular in nature.

![Dodecahedron](https://upload.wikimedia.org/wikipedia/commons/6/6a/Dodecahedron-transparent.gif)

The general approach I can find on Rosetta Code is generally a hardcoded list of points, like as follows:

```ada
   Adjacent_Rooms : constant Rooms :=
     ((1, 4, 7), (0, 2, 9), (1, 3, 11), (2, 3, 13), (0, 3, 5), (4, 6, 14),
      (5, 7, 16), (0, 6, 8), (7, 9, 17), (1, 8, 10), (9, 11, 18), (2, 10, 12),
      (11, 13, 19), (3, 12, 14), (5, 13, 15), (14, 16, 19), (5, 15, 17),
      (8, 16, 18), (10, 17, 19), (12, 15, 18));
```

basically encoding the indices of the points that each point links to. I seek to find out a way to algorithmically generate these points (not necessarily using math), or somehow simulate the grid with an ordinary 1D or 2D array somehow.

Since K isn't a popular language, I would appreciate answers in a pseudocode format so I can translate the approach correctly.