Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Killer007lite on December 07, 2015, 05:12:41 PM

Title: Can someone help please??
Post by: Killer007lite on December 07, 2015, 05:12:41 PM
Wow I've been very active on the forums lately, But apparently, my CRPL skills bring
me back here again (but at least im learning  :D).

I've been trying to create a CRPL code that sends a user defined amount of spores to
a user defined set of coordinates with a user defined delay, I've had countless attempts
and all i got was a code that compiled, but didn't do what it should.

Could someone show me how to fix it?  (attached as a txt doc, its called tutorial 2 because
I was learning about stuff for CRPL)

Thanks
Title: Re: Can someone help please??
Post by: Hubs on December 11, 2015, 09:49:49 AM
Try this


$x:0
$y:0
$del:150
$no_of_spores:1
if (->no_of_spores 1 gte)
CurrentCoords ->x ->y 1 10 CreateSpore
->del delay
<-no_of_spores 1 sub ->no_of_spores
endif
Title: Re: Can someone help please??
Post by: Killer007lite on December 11, 2015, 11:13:29 AM
Unfortunately it did not work  :(, it just sit there looking pretty, it seems as if its just completely missing out the "if" part. Weird.
Title: Re: Can someone help please??
Post by: J on December 11, 2015, 11:47:18 AM
Try this


$x:0
$y:0
$del:150
$no_of_spores:1
if (<-no_of_spores 1 gte)
CurrentCoords ->x ->y 1 10 CreateSpore
->del delay
<-no_of_spores 1 sub ->no_of_spores
endif
Title: Re: Can someone help please??
Post by: Killer007lite on December 11, 2015, 12:01:54 PM
Same thing J, also same code as hubs' but oh well, mistakes happen. :P
Title: Re: Can someone help please??
Post by: J on December 11, 2015, 12:17:23 PM
I changed one set_variable (->) to get_variable (<-), but there were three more that had to be changed, try this one:


$x:0
$y:0
$del:150
$no_of_spores:1
if (<-no_of_spores 1 gte)
CurrentCoords <-x <-y 1 10 CreateSpore
<-del delay
<-no_of_spores 1 sub ->no_of_spores
endif
Title: Re: Can someone help please??
Post by: Killer007lite on December 11, 2015, 12:33:38 PM
Ok Cool it's working now, Thanks J

And so the map making begins....

I wonder if I'm not so good at CRPL because I use python as a coding language.
Title: Re: Can someone help please??
Post by: Grayzzur on December 12, 2015, 11:06:25 PM
The thing with CRPL is wrapping your head around RPN (reverse polish notation - and the stack it uses). Anyone who had one of the old HP RPN calculators probably has less trouble with CRPL. :)