Download presentation
Presentation is loading. Please wait.
Published byAndrzej Urbaniak Modified over 6 years ago
1
Co robi ten kod? [C] bool czyDodatnie(int[] tab, int roz) {
bool dodatnie = true; for(int i>0; i<roz && dodatnie; i++) { if(tab[i] <= 0) dodatnie = false; return dodatnie; }
2
Co robi ten kod? [Ruby] def czyDodatnie(tab) not tab.any? do |liczba| liczba <= 0 end
3
Domieszki są fajne class Costam include Enumerable #... def each end
i mamy metody any?, sort, ...
4
Wygodna składnia person.kill if person.enemy? if(person.enemy()) {
}
5
Wygodna składnia 5.times do puts 'Ruby rulez' end
for(int i = 0; i < 5; i++) { printf("C też może być"); }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.