BLOG: 00123
So, some bastard linked me a 'petals around the rose' game / puzzle / mind-bender of a thing.
You know? I just can't get it! Or at least the way you are meant to :P
So, Lets Get Mathmatical People, With Just A Dash Of Code!
------------------------------------------------------
/* Lurios accepts no responsibility if this code does not work in your compiler! */
int: total=0
int: array[1,5]
void main()
{
/* Set Petals */
for (i = 1, i < 5, i++)
array[1,i] = Rand_Int(6)
/* count petals */
for (i = 1, i < 5, i++){
if array[1,i] ISEVEN
total = total + 0
Else if array[1,i] ISODD
total = total + array[1,i] - 1
}
print{"Number of Petals Around the Rose:" %d, total)
}
(You know, I corrected this solution twice because I kept forgetting to use 'i' in places :P)
------------------------------------------------------
Now, this is not the solution. Or so I have been told, yet the anwser will be correct none-the-less. Also, if one were to use die with more sides, the result will also be true!.
Damn! Some Uni Infinite Sets Logic actualy came into play! And I thought it all hard and unuseful!
Now excuse me, there is someone I have to go hack limbs off of! >:|
0 Comments:
Post a Comment
<< Home