oSumAtrIX / mastermind

🎲 Mastermind - A code-breaking CLI game for two players written in C89
1 stars 0 forks source link

Implement framework #9

Closed oSumAtrIX closed 2 years ago

oSumAtrIX commented 2 years ago
alphakilo11 commented 2 years ago

I'm sorry, but I cannot interpret your construct and node code, so I don't really know how to create my code in a way, that in fits into your framework.

oSumAtrIX commented 2 years ago

We wrap our pointers to structs into nodes. So basically we have:

node_start { content: ptr1,  next: node_2 }
node_2 { content: ptr2,  next: null }
...

This way we can store our pointers in "lists". The listing works by linking the next node to the current node. This way if we have access to node_start, we can access the content of node_start.next which would point to node_2. Now we can continue with node_2 and have access to node_2.content and next node inside node_2.next.