dEEpEst Posted February 7, 2018 Share Posted February 7, 2018 [HIDE-THANKS][LANGUAGE=ruby]#!/usr/bin/env ruby # # Works out what the input integer is divisible by, useful for padbuster. # @input = ARGV[0] def divisible?(i) (@input.to_i % i).zero? end ([email protected]_i).each_with_index do |i| puts "#{@input} is divisible by #{i}" if divisible?(i) end[/LANGUAGE][/HIDE-THANKS] Link to comment Share on other sites More sharing options...
Recommended Posts