Skip to main content
added 8 characters in body
Source Link
Rainbolt
  • 6.4k
  • 6
  • 34
  • 62

RebelNonconformist, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Nonconformist, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end
if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb
added 16 characters in body
Source Link
Martin Ender
  • 198k
  • 67
  • 453
  • 994

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts rand(2)["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts rand(2)
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb

Rebel, Ruby

The opposite of The Tag-Along. She just wants to go against convention and picks the side that has been chosen least often so far

if ARGV.length == 0
    puts ["good", "evil"].sample
else
    all_samples = ARGV[0].gsub(',','')
    n_good_samples = all_samples.count('1')
    puts n_good_samples > all_samples.length/2 ? "evil" : "good"
end

Run like

ruby rebel.rb
Source Link
Martin Ender
  • 198k
  • 67
  • 453
  • 994
Loading