Started by G_G, March 04, 2009, 12:14:28 am
(1).abs #1(-1).abs #1(10).abs #0(-10).abs #10
lines = []file = File.open('Data.txt')file.each_line{|line| lines.push(line)file.closefor i in lines p iend
lines = []file = File.open('Data.txt')file.each_line{|line| lines.push(line.to_i)file.closefor i in lines p iend
file = File.open('Data.txt', 'r')lines = file.readlinesfile.closelines.each {|line| p line}
Quote from: winkioI do not speak to bricks, either as individuals or in wall form.
Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.
s.chomp! # removes whitespace at end of string
Quote from: Jackolas on October 22, 2009, 04:46:33 amHarder than I thought it was gone be best i could do i a short time.To calculate exp needed to lvl:L= LVLB= BaseI= InflationE= EXPE = B * ((L + 4) ^ (2,4 + I / 100)) / (5 ^ (2,4 + I / 100))so the exp needed from lvl 5-6 when base and inflation are both 10 is:10*((5+4)^(2,4+10/100))/(5^(2,4+10/100)) = 56,56854looking in the rmxp actor exp table it says 56yes i know they are a litle bid off...but i think that RMXP is not calculating with numbers behind the ,so it will always round the numbers down
def get_lvl(lvl,exp,expneeded) @e = 25 * ((lvl + 4) ^ (2,4 + 35 / 100)) / (5 ^ (2,4 + 35 / 100)) if exp >= @e lvl += 1 end expneeded = @e - exp return lvl,expneeded end
Quote from: Champion Blizzard on February 22, 2010, 02:36:44 amIn programming you never use a decimal comma. You ALWAYS use a decimal dot.
class Bitmap def get_lvl(exp,x,y) lvl = 1 while exp >= get_exp_list(lvl) lvl += 1 end slvl = lvl - 1 expneeded = get_exp_list(lvl) - exp self.draw_text(x, y, 120, 32, slvl.to_s) self.draw_text(x, y+32, 120, 32, exp.to_s+'/'+get_exp_list(lvl).to_s) end def get_exp_list(lvl) @exp_list = Array.new(101) @exp_list[1] = 0 pow_i = 2.4 + 35 / 100.0 for i in 2..100 if i > 99 @exp_list[i] = 0 else n = 25 * ((i + 3) ** pow_i) / (5 ** pow_i) @exp_list[i] = @exp_list[i-1] + Integer(n) end end return @exp_list[lvl] endend
Quote from: Zydragon on February 22, 2010, 09:38:58 amI dont see the logic in a decimal comma, surely thats only meant to be used for thousands and millions like 9,999,999... The people like us 'silly europeans' would be confused when you say 9,999 is actually 9.999
Quote1 234 567.89
Quote from: fugo ad te, pikachu! on February 22, 2010, 10:33:27 amQuote from: Zydragon on February 22, 2010, 09:38:58 amI dont see the logic in a decimal comma, surely thats only meant to be used for thousands and millions like 9,999,999... The people like us 'silly europeans' would be confused when you say 9,999 is actually 9.999 For writing, I stand by this as the proper form:Quote1 234 567.89which should read as one-million, two-hundred and thirty-four thousand, five-hundred and sixty-seven and eighty-nine hundredths.
Quote from: Zydragon on February 22, 2010, 11:03:04 amQuote from: fugo ad te, pikachu! on February 22, 2010, 10:33:27 amQuote from: Zydragon on February 22, 2010, 09:38:58 amI dont see the logic in a decimal comma, surely thats only meant to be used for thousands and millions like 9,999,999... The people like us 'silly europeans' would be confused when you say 9,999 is actually 9.999 For writing, I stand by this as the proper form:Quote1 234 567.89which should read as one-million, two-hundred and thirty-four thousand, five-hundred and sixty-seven and eighty-nine hundredths.See us British would write that as 1,234,567.89
Quote from: fugo ad te, pikachu! on February 22, 2010, 09:27:39 amQuote from: Champion Blizzard on February 22, 2010, 02:36:44 amIn programming you never use a decimal comma. You ALWAYS use a decimal dot.silly europeans, not following america's vastly superior lead :V
Quote from: Champion Blizzard on February 19, 2010, 02:42:05 amfile = File.open('Data.txt', 'r')lines = file.readlinesfile.closelines.each {|line| p line}
File.open('Data.txt', 'r') {|file| lines = file.readlines lines.each {|line| p line}}