Skip to content

Instantly share code, notes, and snippets.

@masahixixi
masahixixi / gist:3735841
Created September 17, 2012 06:28
ProjectEuler #4
numbers = []
mnumbers = []
mnumbers_rev = []
ans = []
999.downto(1){|down|
numbers << down
}
numbers.each do |numbers_first|
numbers.each do |numbers_second|
@masahixixi
masahixixi / gist:3735540
Created September 17, 2012 04:27
ProjectEuler #3
require "prime"
p 600851475143.prime_division.last
@masahixixi
masahixixi / gist:3735441
Created September 17, 2012 03:45
ProjectEuler #2
a = 1
b = 2
sum = 0
ans = 0
while sum < 4000000
if b % 2 == 0
ans = ans += b
end
sum = a + b
a = b
@masahixixi
masahixixi / gist:1862629
Created February 19, 2012 08:34
twitterBOT
# -*- encoding: utf-8 -*-
require 'twitter'
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
OAUTH_TOEKN = ""
OAUTH_TOEKN_SECRET = ""
Twitter.configure do |config|
config.consumer_key = CONSUMER_KEY