Skip to main content
Commonmark migration
Source Link

SlowReturners - Ruby

#SlowReturners - Ruby SendsSends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    puts (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end

#SlowReturners - Ruby Sends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    puts (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end

SlowReturners - Ruby

Sends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    puts (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end
deleted 1 character in body
Source Link
MegaTom
  • 4.3k
  • 1
  • 21
  • 24

#SlowReturners - Ruby Sends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    printputs (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end

#SlowReturners - Ruby Sends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    print (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end

#SlowReturners - Ruby Sends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    puts (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end
Source Link
MegaTom
  • 4.3k
  • 1
  • 21
  • 24

#SlowReturners - Ruby Sends one servant back every 5 turns.

x=""
while x != "EXIT"
  x=gets.chomp
  if x =~ /^START_TURN (\d*)/
    print (1..5).map{|i|(i<=$1.to_i/5)?"R":"S"}.join(",")
  end
end