This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ダメ解答 | |
f = 1 | |
s = 0 | |
for i in 1..100 do | |
f *= i | |
end | |
n = f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
$(function(){ | |
var ID = $("#id").val(), | |
IDArray = [], | |
$input = $("#input2") | |
red = "#CD2525", | |
green = "#adff2f", | |
blue = "#1E90FF"; | |
for(var i = 0 , max = ID.length ; i < max ; i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
$(function(){ | |
var __VARS__, | |
ID = $("#id").val(), | |
red = "#CD2525", | |
green = "#adff2f", | |
blue = "#1E90FF", | |
$input = $("#input1"); | |
$input.on("keydown keyup",checkID).val(ID).css("backgroundColor",green); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fib | |
def self.calc | |
fibs = [1,1] | |
loop do | |
yield fibs[0] | |
fibs.push fibs.shift + fibs[0] | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Prime | |
def self.calc | |
primes = [2] | |
puts 2 | |
i = 3 | |
loop do | |
max = Math.sqrt(i).floor | |
primes.each do |p| | |
if p > max then | |
yield i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "Monitor" | |
require "./fib.rb" | |
require "./prime.rb" | |
l = Monitor.new | |
h = {} | |
threadF = Thread.new do | |
Fib.calc { |f| |
NewerOlder