Presentation is loading. Please wait.

Presentation is loading. Please wait.

Co robi ten kod? [C] bool czyDodatnie(int[] tab, int roz) {

Similar presentations


Presentation on theme: "Co robi ten kod? [C] bool czyDodatnie(int[] tab, int roz) {"— Presentation transcript:

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ć"); }


Download ppt "Co robi ten kod? [C] bool czyDodatnie(int[] tab, int roz) {"

Similar presentations


Ads by Google