https://www.codingame.com/training/medium/smile-frieze-cheese
Send your feedback or ask for help here!
Created by @nicola,validated by @VirtualAtom,@lapinozz and @Djoums.
If you have any issues, feel free to ping them.
https://www.codingame.com/training/medium/smile-frieze-cheese
Send your feedback or ask for help here!
Created by @nicola,validated by @VirtualAtom,@lapinozz and @Djoums.
If you have any issues, feel free to ping them.
For the last test case
pma2: All transformations excepted horizontal symmetries
If I split pattern as below, it is rotate, not glid-ref
### --#
#-- --#
#-- ###
If I split pattern in another way as below, it is vert-sym + glid-ref, not rotate
#--### ###--#
#----# #----#
###--# #--###
When you say it is both rotate and glid-ref, do you mean we have to use two different splitting methods to see rotate + vert-sym + glid-ref?
You have to identify the group of symmetries of the whole frieze, not of a pattern. Clearly this frieze has glide reflections (e.g. mapping the first half of the second pattern you gave to the second half) and rotations (whose centers are the centers of the first pattern you gave).
I see. So I have to combine results from all possible splits to get the full picture of the pattern type. Thanks.
Thats not clear from the description of the problem.
I treated the pattern as a whole, so for test case 7: its vertical and glide, but not rotate.
I reached 100% by changing the conditions for pma2 detection to require vertical and glide.
If you want people to detect based upon pattern groups in the ribbon, you need to state this in the problem statement and include a test case which checks for this. eg:
##-##-##
#---#-#-
#---#-#-
Which is a p1m1 but cannot be found by simply comparing each line with itself reversed.
You must find the pattern that is repeated with a translation.
Then you must find its symmetrical properties.
Note that the patterns are complete, none of them are cropped.
In the case mentioned by @java_coffee_cup, the minimal periodic pattern has no rotational symmetry (or, equivalently, central symmetry, as rotations can only be 180° here), while the whole frieze has some. That’s why it’s slightly more complicated than what you say (and, as @MarkGossage mentions, one simple way to circumvent the problem is to use the fact that we know that vertical & glide symmetries => rotation symmetry).