Can someone help please??

Started by Killer007lite, December 07, 2015, 05:12:41 PM

Previous topic - Next topic

Killer007lite

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

Hubs

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

Killer007lite

Unfortunately it did not work  :(, it just sit there looking pretty, it seems as if its just completely missing out the "if" part. Weird.

J

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

Killer007lite

Same thing J, also same code as hubs' but oh well, mistakes happen. :P

J

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

Killer007lite

#6
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.

Grayzzur

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. :)
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker