Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Sorrontis on June 05, 2016, 02:42:13 PM

Title: Rad2Deg // Deg2Rad
Post by: Sorrontis on June 05, 2016, 02:42:13 PM
I've followed the guide, but the compiler does not recognize it. Any hints?
Title: Re: Rad2Deg // Deg2Rad
Post by: Grayzzur on June 05, 2016, 03:11:35 PM
Sample code on how you're trying to use it? Which version of CW3?
Title: Re: Rad2Deg // Deg2Rad
Post by: Sorrontis on June 05, 2016, 03:15:15 PM
Quote from: Grayzzur on June 05, 2016, 03:11:35 PM
Sample code on how you're trying to use it? Which version of CW3?

Version 2.12

Code I was using was either:

<-Radians Rad2Deg mul ->Degrees

or

<-Radians Rad2Deg ->Degrees

The compiler just sees Rad2Deg as a variable and asking for <- or -> or @ (the usual error)
Title: Re: Rad2Deg // Deg2Rad
Post by: Grayzzur on June 05, 2016, 03:40:11 PM
Looks like those constants were added to the wiki in March 2015. I think CRPL was pretty much finalized long before then, and I don't see those keywords in the Notepad++ syntax docs either.

You could always multiply by PI and divide by 180 (or vice versa). :)
Title: Re: Rad2Deg // Deg2Rad
Post by: Sorrontis on June 05, 2016, 03:53:36 PM
Quote from: Grayzzur on June 05, 2016, 03:40:11 PM
Looks like those constants were added to the wiki in March 2015. I think CRPL was pretty much finalized long before then, and I don't see those keywords in the Notepad++ syntax docs either.

You could always multiply by PI and divide by 180 (or vice versa). :)

That's what I ended up doing. It was only for my trace anyways, I work better in degrees (engineer vs mathematician) :D
Title: Re: Rad2Deg // Deg2Rad
Post by: knucracker on June 05, 2016, 04:23:29 PM
Hmmm... I would have sworn they were there in CRPL.... but that's memory for you.  I looked and they are definitely not there. 
I added them to PRPL a while back, though.

These are some additional constants there in PRPL for particle fleet:
TAU, TWOPI, HALFPI, QUARTERPI, RAD2DEG, DEG2RAD

( http://www.scientificamerican.com/article/let-s-use-tau-it-s-easier-than-pi/ )
Title: Re: Rad2Deg // Deg2Rad
Post by: Sorrontis on June 05, 2016, 05:16:56 PM
What's PRPL? Now I'm confused  :o
Title: Re: Rad2Deg // Deg2Rad
Post by: Builder17 on June 05, 2016, 05:20:15 PM
PRPL = CRPL in particle fleet , or game 4.
Title: Re: Rad2Deg // Deg2Rad
Post by: Sorrontis on June 05, 2016, 07:01:50 PM
Fair enough.
Title: Re: Rad2Deg // Deg2Rad
Post by: GoodMorning on June 05, 2016, 10:01:46 PM
Particle Reverse Polish Language. Search it, it's got a topic already, and a long discussion.