Last active
August 15, 2020 19:20
-
-
Save leohmoraes/08adc4b61a460be71b2ed29f959b2f80 to your computer and use it in GitHub Desktop.
Ep03 - Dart - Funcoes puras e transparencia referencial
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
//https://youtu.be/4EzUtx-Q58I?t=1769 | |
//Funcoes puras e transparencia referencial | |
import 'dart:math'; | |
/// Funcao pura = sem side-effects | |
/// Altera somente as variaveis intenas | |
/// Doubles [n]. | |
int double(int n) => n * 2; | |
/// Generate a possibly negative integer from -[max] to [max]. | |
int randomIntWithNegative(int max) => | |
Random().nextInt(max) * (Random().nextBool() ? 1 : -1); | |
main(){ | |
} | |
/// Run https://dartpad.dev/08adc4b61a460be71b2ed29f959b2f80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment