[Community Puzzle] Compiler CG86 (Easy Version) - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @abdelmathin,validated by @IGOX008,@a7aQC,@DeanTheMachine and @Delicious31415.
If you have any issues, feel free to ping them.

Nice one!
Description is a bit cryptic when it comes to an exception for REPEAT instruction (an example would definitely help)

I also did not get it at first read, but there ARE examples: you can always look at the IDE test cases’ input & expected output…

i think the sentence: " The REPEAT instruction applies only to consecutive identical operations." it’s not correct… due to, the exception rule says exactly the contrary… i notice the REPEAT is NOT over consecutive operations. like in Test 7 with “+3” argument and Test 9 with " - 9" argument.

my recommendation is to change the line: " The REPEAT instruction applies only to consecutive identical operations." to " The REPEAT instruction applies only to identical operations."

and to remove the exception rule

Thanks guys! Do you agree with what @ManuelJ said? I think the exception statement might be causing the confusion. If most of you agree, I’ll change it.

My suggested revisions are:

  • Replace “repeated operations” with “identical operations” in paragraph 2.

  • Delete “The REPEAT instruction applies only to consecutive identical operations.”

  • Delete the entire exception paragraph.

  • Add “A positive number that appears at the beginning of an expression is treated as an addition of that number. Likewise, a negative number is treated as a subtraction.”

  • Add “Identical operations must be compressed using the {{REPEAT}} instruction, even if they do not appear consecutively in the original expression”.

  • Add “{{+}} [[X]] and {{-}} [[X]] cannot be compressed together (i.e. netted off each other) even if [[X]] has the same value.”

4 people approved, and even so, there are many corrections need to be done to description - sad