patternModerate
You have no respect for logic
Viewed 0 times
youlogicforrespecthave
Problem
Inspired by Hosch250, TopinFrassi, Legato and the recent milestone of having our 100th fizzbuzz question on Code Review I decided to add an ArnoldC FizzBuzz to the collection.
I haven't found any best practices about the language, but I assume the code needs to be VERBOSE. For those unfamiliar with the language, a small excerpt of the keywords:
The challenge itself doesn't need introduction. Write all numbers from 1 up till and including 100, but:
`LISTEN TO ME VERY CAREFULLY modulo
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividend
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE divisor
GIVE THESE PEOPLE AIR
HEY CHRISTMAS TREE quotient
YOU SET US UP 0
HEY CHRISTMAS TREE remainder
YOU SET US UP 0
HEY CHRISTMAS TREE product
YOU SET US UP 0
GET TO THE CHOPPER quotient
HERE IS MY INVITATION dividend
HE HAD TO SPLIT divisor
ENOUGH TALK
GET TO THE CHOPPER product
HERE IS MY INVITATION divisor
YOU'RE FIRED quotient
ENOUGH TALK
GET TO THE CHOPPER remainder
HERE IS MY INVITATION dividend
GET DOWN product
ENOUGH TALK
I'LL BE BACK remainder
HASTA LA VISTA, BABY
LISTEN TO ME VERY CAREFULLY divisible
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividend
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE divisor
GIVE THESE PEOPLE AIR
HEY CHRISTMAS TREE result
YOU SET US UP 0
GET YOUR ASS TO MARS result
DO IT NOW modulo dividend divisor
HEY CHRISTMAS TREE isZero
YOU SET US UP 0
GET TO THE CHOPPER isZero
HERE IS MY INVITATION result
YOU ARE NOT YOU YOU ARE ME 0
ENOUGH TALK
I'LL BE BACK isZero
HASTA LA V
I haven't found any best practices about the language, but I assume the code needs to be VERBOSE. For those unfamiliar with the language, a small excerpt of the keywords:
True NO PROBLEMO
ModuloOperator I LET HIM GO
DeclareInt HEY CHRISTMAS TREE
AssignVariable GET TO THE CHOPPERThe challenge itself doesn't need introduction. Write all numbers from 1 up till and including 100, but:
- Write
Fizzinstead of the number when divisible by 3
- Write
Buzzinstead of the number when divisible by 5
- Write
FizzBuzzinstead of the number when divisible by 15
`LISTEN TO ME VERY CAREFULLY modulo
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividend
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE divisor
GIVE THESE PEOPLE AIR
HEY CHRISTMAS TREE quotient
YOU SET US UP 0
HEY CHRISTMAS TREE remainder
YOU SET US UP 0
HEY CHRISTMAS TREE product
YOU SET US UP 0
GET TO THE CHOPPER quotient
HERE IS MY INVITATION dividend
HE HAD TO SPLIT divisor
ENOUGH TALK
GET TO THE CHOPPER product
HERE IS MY INVITATION divisor
YOU'RE FIRED quotient
ENOUGH TALK
GET TO THE CHOPPER remainder
HERE IS MY INVITATION dividend
GET DOWN product
ENOUGH TALK
I'LL BE BACK remainder
HASTA LA VISTA, BABY
LISTEN TO ME VERY CAREFULLY divisible
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividend
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE divisor
GIVE THESE PEOPLE AIR
HEY CHRISTMAS TREE result
YOU SET US UP 0
GET YOUR ASS TO MARS result
DO IT NOW modulo dividend divisor
HEY CHRISTMAS TREE isZero
YOU SET US UP 0
GET TO THE CHOPPER isZero
HERE IS MY INVITATION result
YOU ARE NOT YOU YOU ARE ME 0
ENOUGH TALK
I'LL BE BACK isZero
HASTA LA V
Solution
There's incorrect/inconsistent indentation in:
and
The ArnoldC wiki says you should declare 0s and 1s as the "macros"
In your method
The indentation in these two blocks is two vs four:
and:
You ought to stick to one consistently.
There we go! Using the macros!
Oh, wait...
Never mind...
And again...
HEY CHRISTMAS TREE result
YOU SET US UP 0and
HEY CHRISTMAS TREE isZero
YOU SET US UP 0The ArnoldC wiki says you should declare 0s and 1s as the "macros"
@I LIED and @NO PROBLEMOHEY CHRISTMAS TREE isZero
YOU SET US UP @I LIEDIn your method
divisible, the end of method statement is not on the same indentation as the start declaration.The indentation in these two blocks is two vs four:
IT'S SHOWTIME
HEY CHRISTMAS TREE maxValueand:
LISTEN TO ME VERY CAREFULLY divisible
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividendYou ought to stick to one consistently.
IT'S SHOWTIME
HEY CHRISTMAS TREE maxValue
YOU SET US UP @NO PROBLEMOThere we go! Using the macros!
Oh, wait...
HEY CHRISTMAS TREE n
YOU SET US UP 0Never mind...
And again...
HERE IS MY INVITATION n
GET UP 1Code Snippets
HEY CHRISTMAS TREE result
YOU SET US UP 0HEY CHRISTMAS TREE isZero
YOU SET US UP 0HEY CHRISTMAS TREE isZero
YOU SET US UP @I LIEDIT'S SHOWTIME
HEY CHRISTMAS TREE maxValueLISTEN TO ME VERY CAREFULLY divisible
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividendContext
StackExchange Code Review Q#112825, answer score: 18
Revisions (0)
No revisions yet.