summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorKenichi Kamiya <kachick1@gmail.com>2019-08-17 15:03:00 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 15:03:00 +0900
commit9d20d2b0f5096fab210464f9e16d876f9c5d319f (patch)
tree9e1613bf75f9d85038a79ee3113ebac1ad4d7ce1 /sample
parent72adc6cffbc41988aee728d74ab0bed2c5159948 (diff)
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
Diffstat (limited to 'sample')
-rw-r--r--sample/biorhythm.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/sample/biorhythm.rb b/sample/biorhythm.rb
index bd7c39f5aa..f5d189014b 100644
--- a/sample/biorhythm.rb
+++ b/sample/biorhythm.rb
@@ -25,7 +25,7 @@
# Environment: basic, dos, os9
include Math
-require "date.rb"
+require "date"
require "optparse"
require "optparse/date"
@@ -36,11 +36,10 @@ def print_header(y, m, d, p, w)
end
def get_position(z)
- pi = Math::PI
z = Integer(z)
- 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
- geist =(50.0 * (1.0 + sin((z / 33.0 - (z / 33)) * 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
+ geist =(50.0 * (1.0 + sin((z / 33.0 - (z / 33)) * 360.0 * PI / 180.0))).to_i
return phys, emot, geist
end