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
void main() { | |
var number = 20; | |
print('fibonacci($number) = ${fibonacci(number)}'); | |
} | |
int fibonacci(int number) { | |
return number < 2 ? number : (fibonacci(number - 1) + fibonacci(number - 2)); | |
} |
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
void main() { | |
Map<String, bool> modules = { | |
'm105': true, | |
'm133': false, | |
'm226': false, | |
'm213': true | |
}; | |
modules.forEach((module, done) => done ? print('J\'ai déjà suivi le module $module') : ''); | |
} |
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
void main() { | |
transport(6); | |
transport(18); | |
transport(20); | |
transport(32); | |
transport(55); | |
transport(75); | |
} |
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
void main() { | |
double kilometers = 3; | |
print('$kilometers kilomètres est égal à ${kilometersToMiles(kilometers)} miles'); | |
} | |
double kilometersToMiles(double kilometers) { | |
return kilometers / 1.609; | |
} | |
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
void main() { | |
// Dart: Exercice n°3 | |
// Avec une boucle for | |
for (int i = 0; i <= 100; i++) { | |
if (i % 2 == 0) { | |
print('$i est un nombre pair'); | |
} | |
} | |
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
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_extra_bottom": 1, | |
"caret_extra_top": 1, | |
"caret_extra_width": 1, | |
"caret_style": "blink", | |
"color_scheme": "Packages/Materialize/schemes/Material Monokai.tmTheme", | |
"default_line_ending": "unix", | |
"fade_fold_buttons": false, |
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 embed_gist( $atts ) { | |
// Attributes | |
extract( shortcode_atts( | |
array( | |
'id' => '', | |
), $atts ) | |
); | |
// Code | |
return '<script src="https://gist.github.com/' . $atts['id'] . '.js"></script>'; |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(1000); |