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 Integer | |
def factor_of? (other) | |
other % self == 0 | |
end | |
end | |
1.upto(100) do |x| | |
bt = (3.factor_of?(x) ? "" :"not ") + "divisible by 3" | |
bf = (5.factor_of?(x) ? "" : "not ") + "divisible by 5" | |
puts "The value #{x} is #{bt} and is #{bf}" |
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 ( a , { t } ) | |
{// t:#s.name.loc | |
var c = { } , p , v , r , x , s , i = 0 , | |
P = "red0purple0blue0cyan0green0lime0yellow0orange020305070110130170190230290310370410430470530590610670710730790830890970unlock0open0release" . split ( 0 ) , | |
z = "21!|35!|40!|1!|2!|3!|or n|d c| com|k c|color_digit|c002_complement|c003_triad_1|c003_triad_2|!d|t d|pr", | |
Z = z . split ( '|' ) | |
for ( ; v = ( r = t . call ( c ) ) . match ( z ) ; c [ p ] = x , i ++ ) | |
s = Z . indexOf ( v = v [ 0 ] ) , | |
s > 15 ? c . ez_prime = + P [ i % 25 + 8 ] : |