Clean sample code biorhythm (#2375)
* Standardize to load date libary code > git grep 'require .date.' | wc -l 179 > git grep 'require .date\.rb' | wc -l 1 * Simplify
This commit is contained in:
parent
72adc6cffb
commit
9d20d2b0f5
@ -25,7 +25,7 @@
|
|||||||
# Environment: basic, dos, os9
|
# Environment: basic, dos, os9
|
||||||
|
|
||||||
include Math
|
include Math
|
||||||
require "date.rb"
|
require "date"
|
||||||
require "optparse"
|
require "optparse"
|
||||||
require "optparse/date"
|
require "optparse/date"
|
||||||
|
|
||||||
@ -36,11 +36,10 @@ def print_header(y, m, d, p, w)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def get_position(z)
|
def get_position(z)
|
||||||
pi = Math::PI
|
|
||||||
z = Integer(z)
|
z = Integer(z)
|
||||||
phys = (50.0 * (1.0 + sin((z / 23.0 - (z / 23)) * 360.0 * pi / 180.0))).to_i
|
phys = (50.0 * (1.0 + sin((z / 23.0 - (z / 23)) * 360.0 * PI / 180.0))).to_i
|
||||||
emot = (50.0 * (1.0 + sin((z / 28.0 - (z / 28)) * 360.0 * pi / 180.0))).to_i
|
emot = (50.0 * (1.0 + sin((z / 28.0 - (z / 28)) * 360.0 * PI / 180.0))).to_i
|
||||||
geist =(50.0 * (1.0 + sin((z / 33.0 - (z / 33)) * 360.0 * pi / 180.0))).to_i
|
geist =(50.0 * (1.0 + sin((z / 33.0 - (z / 33)) * 360.0 * PI / 180.0))).to_i
|
||||||
return phys, emot, geist
|
return phys, emot, geist
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user