Difference between revisions of "Moon phase"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m (Created page with 'http://kolmafia.us/showthread.php?1860-question-about-moon-functions&p=11453&viewfull=1#post11453')
 
imported>Bale
m
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
http://kolmafia.us/showthread.php?1860-question-about-moon-functions&p=11453&viewfull=1#post11453
+
{{
 +
#vardefine:name|moon_phase}}{{
 +
#vardefine:return_type|int}}{{
 +
 
 +
FunctionPage|
 +
name={{#var:name}}|
 +
 
 +
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
}}|
 +
 
 +
function_description=Returns the moon phase, between 0 and 15.</p>
 +
<p>
 +
* Grimace = moon_phase() / 2
 +
* Ronald = moon_phase() modulo 8
 +
Now compare the number for each to the following:
 +
* 0 new moon
 +
* 1 waxing crescent
 +
* 2 first quarter
 +
* 3 waxing gibbous
 +
* 4 full moon
 +
* 5 waning gibbous
 +
* 6 third quarter
 +
* 7 waning crescent</p>
 +
<p>Note that this function does not return any information regarding the mini-moon.|
 +
 
 +
needscode=yes|
 +
 
 +
see_also={{SeeAlso|moon_light}}|
 +
cli_equiv=The CLI command "moon" gives text output that includes moon phases.|
 +
more_info=See [http://kolmafia.us/showthread.php?1860-question-about-moon-functions&p=11453&viewfull=1#post11453 this thread] for more information.|
 +
}}
 +
 
 +
[[Category:Your Character]]

Latest revision as of 21:41, 21 May 2010

needs(code_samples);

Function Syntax

int moon_phase()

Returns the moon phase, between 0 and 15.

  • Grimace = moon_phase() / 2
  • Ronald = moon_phase() modulo 8

Now compare the number for each to the following:

  • 0 new moon
  • 1 waxing crescent
  • 2 first quarter
  • 3 waxing gibbous
  • 4 full moon
  • 5 waning gibbous
  • 6 third quarter
  • 7 waning crescent

Note that this function does not return any information regarding the mini-moon.

CLI Equivalent

The CLI command "moon" gives text output that includes moon phases.

See Also

moon_light()

More Information

See this thread for more information.