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
def generate_pool likes, comments | |
all = likes.dup.concat(comments).uniq | |
puts "总人数#{all.count}" | |
puts "点赞党有#{likes.uniq.count}" | |
puts "评论党有#{comments.uniq.count}" | |
puts "计算权重ing..." | |
hash = all.reduce(Hash.new(0)) {|m, o| | |
priority = 1; | |
priority = 2 if comments.include?(o) | |
m[o] = priority |
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
source 'https://rubygems.org' | |
gem 'minitest' |
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 Interpreter | |
def do_a() print "there, "; end | |
def do_d() print "Hello "; end | |
def do_e() print "!\n"; end | |
def do_v() print "Dave"; end | |
Dispatcher = { | |
"a" => instance_method(:do_a), | |
"d" => instance_method(:do_d), | |
"e" => instance_method(:do_e), | |
"v" => instance_method(:do_v) |
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
// Hey there! | |
// This is CODE, lets you control your character with code. | |
// If you don't know how to code, don't worry, It's easy. | |
// Just set attack_mode to true and ENGAGE! | |
var attack_mode=false | |
game_log("My current Speed is " + character.speed) | |
//Source code of: use_hp_or_mp | |
function my_use_hp_or_mp() |