Compatibilidade: necessária a flag deboísmo no BIOS 😃
/* Preparativos:
*
* - Silencie seu telefone: é deselegante interromper a pessoa que está te ajudando;
* - Vá com tempo: considere não usar um "intervalinho",
| Procedure Soma (Var Valor_1, Valor_2 : Integer); | |
| Var Soma : Integer; | |
| Begin | |
| Soma := Valor_1 + Valor_2; | |
| Writeln ('Soma = ', Soma); | |
| End; | |
| // https://gist.github.com/marciojrtorres/3065c164af0b89eb033a108b1936ed3a |
| /* | |
| * Os códigos aparecerão em fonte de largura fixa, | |
| * como neste bloco. | |
| */ | |
| public class UmaClasse { | |
| private String umAtributo; | |
| public String umMetodo(int umParametro) { | |
| int umRetorno = umParametro * 2; | |
| return this.umAtributo + umRetorno; | |
| } |
| // simulando batalha | |
| Arma[] armas = new Arma[]{martelo, arco, poMagico}; | |
| Escudo[] escudos = new Escudo[]{escudoFerro, escudoMagico, escudoMagico}; | |
| int personagensVivos = personagens.length; | |
| Personagem vencedor = null; | |
| while (personagensVivos > 1) { | |
| Personagem p1 = personagens[(int)(Math.random() * personagens.length)]; | |
| Personagem p2 = p1; | |
| while (p1 == p2) p2 = personagens[(int)(Math.random() * personagens.length)]; | |
| p1.ataca(p2); |
Trabalho destinado à disciplina de Elementos da Teoria da Computação e Automação, aos cuidados do professor Dr. Leonardo Emmendorfer.
Discente: 111989 - Márcio J. Ramos Torres Data: 2016-05-09
Disponível on-line no endereço https://gist.github.com/marciojrtorres/5bf013f419e3dc4a51bcc59d8c41ff44
Introdução
| ; Factorial ITERATIVE | |
| JMP main | |
| number: DB 5 ; input number | |
| main: | |
| MOV C, [number] | |
| CALL factorial | |
| HLT | |
| ;((0,1),(1,1),(2,2),(3,6),(4,24),(5,120)) | |
| factorial: |
| <?php | |
| $colunaDiferente = $_SESSION['janelaBusca'][$_POST['idJanela']]['colunaDiferente']; | |
| if(is_array($colunaDiferente)){ | |
| if (is_array($vet)){ | |
| foreach ($vet as $k=>$v){ | |
| foreach ($v as $k1=>$v1){ | |
| foreach ($v1 as $k2=>$v2){ | |
| foreach ($colunaDiferente as $k3=>$v3){ | |
| if ($vet[$k]['r'][$k2]['c'] == $k3) { |
| <?php | |
| // ... | |
| // formatando o número da nota para 9 dígitos | |
| // da pior maneira possível | |
| if ($numero_nota >= 1 && $numero_nota < 10) { | |
| $numero_nota = '00000000' . $numero_nota; | |
| } else if ($numero_nota >= 10 && $numero_nota < 100) { | |
| $numero_nota = '0000000' . $numero_nota; | |
| } else if ($numero_nota >= 100 && $numero_nota < 1000) { | |
| $numero_nota = '000000' . $numero_nota; |
| public class StringUtil { | |
| public static String trimLeft(String string) { | |
| char[] chars = string.toCharArray(); | |
| int i = 0; | |
| for (; i < chars.length; i++) if (chars[i] != ' ') break; | |
| return new String(subArray(chars, i, chars.length)); | |
| } | |
| public static String trimRight(String string) { | |
| char[] chars = string.toCharArray(); | |
| int i = chars.length - 1; |
| public class Util { | |
| public static int dias(int mes, int ano) { | |
| if (mes == 1) { | |
| return 31; | |
| } else { | |
| if (mes == 2) { | |
| if (ano % 400 == 0) { | |
| return 29; | |
| } else { |