-
require выражения
-
include выражения
-
определение классов и модулей
-
основная часть программы
-
код для тестирования
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- TUMBLR APPEARANCE OPTIONS --> | |
<meta name="if:Include Like Button" content="0"> | |
<meta name="if:Include Tweet Button" content="0"> |
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
HANDY ONE-LINERS FOR RUBY November 16, 2005 | |
compiled by David P Thomas <davidpthomas@gmail.com> version 1.0 | |
Latest version of this file can be found at: | |
http://www.fepus.net/ruby1line.txt | |
Last Updated: Wed Nov 16 08:35:02 CST 2005 | |
FILE SPACING: |
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
for i in [1..100] | |
console.log(['Fizz' if i % 3 is 0] + ['Buzz' if i % 5 is 0] or i) |
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
for (var i=1; i<=100; i++) { | |
var string = ''; | |
if (i % 3 == 0) { | |
string += 'Fizz'; | |
} | |
if (i % 5 == 0) { | |
string += 'Buzz'; | |
} |
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
1.upto(100) { |i| puts "#{[:Fizz][i%3]}#{[:Buzz][i%5]}"[/.+/m] || i } |
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
for(i=0;i<100;console.log(++i%15?i%5?i%3?i:f='Fizz':b='Buzz':f+b)); |
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
for(var i=1; i<=100; console.log((i%3?'':'Fizz')+(i%5?'':'Buzz')||i), i++); |
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
for (var i=1; i<=100; i++) console.log( (i % 3 === 0 ? 'Fizz' : '') + (i % 5 === 0 ? 'Buzz' : '') || i ); |
OlderNewer