This file contains hidden or 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
# Hodiaŭ ni parolas pri krommarĝenoj en la kodado de komputilaj programoj. | |
# | |
# Krommarĝenoj en la fontkodo de komputilaj programoj estas tiuj kromaj spacetoj foje troviĝantaj komence de linioj | |
# kaj kiuj helpas vertikale organizi la fontkodon kaj faciligi ĝian legadon. Ni esploru la sekvan kodon: | |
se 5 == 4 | |
eligu 'ili egalas' | |
male | |
eligu 'ili ne egalas' | |
fino |
This file contains hidden or 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
# Module for operations with numbers | |
module Numbers | |
def self.prime?(num) | |
return false if num <= 1 | |
(2..Math.sqrt(num)).none? { |i| (num % i).zero? } | |
end | |
end | |
# Describes a Book object the can tell you how | |
# many times a word appears in it's content |