Thread: Fun Challenge!
View Single Post
  #7  
Old 01-24-2004, 08:49 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
OK here are the results!

My best solution was the best one Schoko came up with
NPC Code:

a = int(int(random(1,7))/7*10);


(Hehe 7 is an interesting number ;D)

My other one liner was only matched by Loriel
Mine:
NPC Code:

a = int(random(0,3)) * 3 + int(random(1,3));


Loriels:
NPC Code:

a = 1 + int(random(0, 2)) + 3 * int(random(0, 3));



Loriel summited this, then Darkshadows_Legend Matched it
NPC Code:

a = strtofloat(#R(1,2,4,5,7,8));



Similiar to that was one Shadowblaze (Zelph_Mystick), adam, and darkshadows_legend did
NPC Code:

a = strtofloat(#e(int(random(0,6)),1,"124578"));



Moving on after the one liners:
Rick (Thought), Loriel, Darkshadows_Legend, r0bin and myself came up with this (which is the most efficient via cpu resources)

NPC Code:

b = {1,2,4,5,7,8};
a = b[int(random(0,6))];



Schoko made these two interesting ones
NPC Code:

while (a % 3 == 0)
a = int(random(1,9));


NPC Code:

a = int(random(3,9));
a = a%3==0?a/3:a;



r0bin came up with a similiar two
NPC Code:

a=int(random(1,9));
while (a==3||a==6)
a=int(random(1,9));


NPC Code:

a=int(random(3,9));
a=a==3||a==6?int(random(1,2)):a;



Loriel did this interesting guy
NPC Code:

a = int(random(0, 6);
a += 1 + int(a / 2);



James (Andy0687) did this one
NPC Code:

tokenize 1 2 4 5 7 8;
a = strtofloat(#t(int(random(0,6)));



Dach did this... not sure if it works but he can fix it if not XD
NPC Code:

a = timevar%9+1;
a = a/3==int(a/3)?a-1:a;



Darkshadows_Legend did this one
NPC Code:

rand = int(random(1,8));
a = (rand in {3,6} ? rand-1:rand);



Xecutor did this which seemed to add extra work XD
NPC Code:

for (i = 1; i <= 8; i ++) {
setstring num#v(i),#v(i);
}
ans = #R(num1,num2,num4,num5,num7,num8);



and ill post Spyders since he sent me the obvious =D
Spyder
NPC Code:

a=int(random(1,7));
if (a==3)
a = 7;
if (a==6)
a = 8;



Do you have an interesting one? Post it =)
__________________

Last edited by Kristi; 01-24-2004 at 09:11 AM..
Reply With Quote