Jump to content

Celtic Knot Puzzle "Pseudo Code" help

MzCatieB

OK so i am in no way shape or form a programmer/Coder, i'm primarily a visual artist (3D graphics, Animations .ext)

However im trying to branch out my skills a little in to Game coding.

So far i have created a basic concept behind a randomly generating puzzle but as i'm not a coder i feel like i have either over complicated things or i'm forgetting allot.
 

Ok lets get started:

 

The concept:

The basic concept to a Celtic Knot Puzzle is to rotate the rings to match up symbols on each loop, Generally Consisting of 3 Rings/Loops with multiple overlaps we need to create a Randomization of both the symbols and positioning of all the symbols.

 

 
 
 
 

X

 
 
 

X

Y

Z

5

6

7

8

9

Y

 
 

1

1

1

4

5

6

7

A

9

Z

 

2

D

F

3

4

5

6

B

C

9

 

3

3

E

2

3

4

 

12

11

10

 

4

4

4

1

D

E

14

13

12

11

 

5

5

5

 

1

F

15

14

13

12

 

6

6

6

 
 

1

16

15

14

13

 

7

7

B

 
 
 
 
 
 
 
 

8

A

C

 
 
 
 
 
 
 
 

9

9

9

 
 
 
 
 
 
 
 

A

C

10

 
 
 
 
 
 
 
 

B

11

11

 
 
 
 
 
 
 
 

12

12

12

 
 
 
 
 
 
 
 

13

13

13

 
 
 
 
 
 
 
 

14

14

14

 
 
 
 
 
 
 
 

E

15

15

 
 
 
 
 
 
 
 

D

F

16

Red = Loop X
Blue = Loop Y
Green = Loop Z

Yellow = Overlap

Letters A-F are to show the points of overlap in each loop.

 

Moving/Rotating the loops:

To put it simply when Anti / Clockwise X/Y/Z is clicked move Values +/- 1 position
If point 16 = Position 16 then Move 16 to position 1 (This will create a looping illusion)

 

Randomizing the starting positions:

The easiest way to start each loop randomly is to tell each loop to Randomly select a value between 1-16… To make sure that Each loop doesnt start of with Position X:1, Y:1, Z:1 (Thus finishing the puzzle before we even start)
This needs to be predefined before loading the GUI

we need to also add in a additional set of code to say;

If X = Value : then Y/Z cannot = same Value
If Y = Value : then X/Z cannot = Same Value
If Z = Value : then X/Y cannot = Same Value
To avoid potential looping we should also make it set the values in order;
Set X Value
Set Y Value (According to above parameters)
Set Z Value (According to above parameters)
 

Next we need to “Match” each letter to be the same symbol / Icon
The best way to do this is predefine Each Letter before loading the GUI

 

A = (Randomized Icon Code)
B = (Randomized Icon Code)
C = (Randomized Icon Code)
D = (Randomized Icon Code)
E = (Randomized Icon Code)
F = (Randomized Icon Code)
 

This sistered with the Randomization system Should give us the basic functions for a Celtic Knot Puzzle.

However this isnt the last of the code needed for the puzzle to work fully
We also need to stop the Icon’s from repeating (this should be possible by incorporating more than 16 Logo’s to choose from) And we also need to add in a “Overlap Detection”
 

Overlap Detection:
This shouldn't be difficult… We merely create a variable on the grid tagged (Overlap A-F)
To detect similar symbols we can do:
Overlap X:A = Symbol Name/Number

Overlap Y:A = Symbol Name/Number

If X & Y = Same Symbol Name/Number then = True

If X & Y = Different Symbol Name/Number then = False

If Overlap = True then Highlight
If Overlap = False then Do not Highlight

 

Anti Repeating:

There is 2 ways we can stop repeating (repeating can give us multiple solutions so we dont want this)

Solution one:

Use more than 16+16+16 symbols (this can in theory remove the problem but can in theory also cause conflict with the randomization system)

Solution two:

Would be identifying the existing patterns in each loop
X = 9,2,3,2 repeat
Y = 1,1,1,5 repeat
Z = 2,3,2,9 repeat

Then create an “counter Algorithm” for each loop, This will be the best solution as it will leave us with 1 available set of unlocks meaning less data is wasted on Symbols & Icons

 

Any suggestions for tweaks & changes?

Character artist in the Games industry.

Link to comment
Share on other sites

Link to post
Share on other sites

You can't have success without succ

Roses are red

My name is Roy

We caught the alligator that ate the De Luca boy

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, UberGamerKing said:

You can't have success without succ

Like i said im not a coder... But that isnt really feedback :| more a statement :/ 

Character artist in the Games industry.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×