[Community Puzzle] The weight of words

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Darazdeblek,validated by @papyjo,@FredericLocquet and @InSync.
If you have any issues, feel free to ping them.

I don’t get the algorithm to decrypt.

Should you calculate the weight of each row/column in the beginning, before each step of before each rotation?

Ok, you have to calculate weights before each rotation.

Yes, the weights have to be calculated for the columns and the rows at each step but it seems like you figured it out :slight_smile:

Hello, I can’t figure this out.
@tglaria says:

  • Method 1: you have to calculate weights before each rotation, so before each column rotation and before each row rotation (“on-the-fly”)

but you @Darazdeblek say:

  • Method 2: the weights have to be calculated at each step, meaning (at least for me) that the weights need to be calculated before doing the rotations of all the columns and rows for the current step.

EDIT: I’ve walked through it on paper and compared with my algorithm, and found my mistake.
Indeed, you need to apply Method 1 :slightly_smiling_face:
Thanks for the cool puzzle! It’s really satisfying to see the decoded result once it works!

1 Like

I spent much longer on this than I should have because of a silly mistake.
It’s a great puzzle, but it’s one where it’s hard to figure out what’s going wrong, because even a slight mistake can make the output wildly wrong.

Please add to the Puzzle statement that the weights should be calculated before each rotation. This will save a lot of people from a lot of headaches. :wink:

To understand the description example, here are the steps :slight_smile:

  1. Step 1
    • Afer column move :
      YEOS
      CDAE
    • Afer row move :
      YEOS
      ECDA
  2. Step 2
    • Afer column move :
      YEDS
      ECOA
    • Afer row move :
      SYED
      ECOA
  3. Step 3
    • Afer column move :
      SYEA
      ECOD
    • Afer row move :
      EASY
      CODE

Thanks @RealSaitama - this helped me. Interestingly enough for this puzzle the main challenge is to get it right at least once - once you manage to get the first case right, the rest will also succeed (at least, that is my impression).
I think it would help this puzzle if as a first case, a case is included with n=1. Currently you either get the decryption right and solve the whole puzzle, or you get it wrong but there is no way to check whether you made a coding mistake or an interpretation mistake.

To understand the first case even more, step 1 in detail:

  • Start grid:
    YDOS
    CEAE
  • Weights of columns: Y + C = 89 + 67 = 156; D + E = 137, O + A = 144, S + E = 152. Hence, characters in those columns must move down 156, 137, 144 and 152 steps, respectively.
  • Result after this column move:
    YEOS
    CDAE
  • Weight of these rows: Y + E + O + S = 320; C + E + A + E = 269. Hence, characters of those rows must move right 320 and 269 steps, respectively.
  • Result after this row move:
    YEOS
    ECDA