This file contains hidden or 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 trampoline(f) { | |
| return function trampolined(...args) { | |
| let result = f.bind(null, ...args); | |
| while (typeof result === 'function') result = result(); | |
| return result; | |
| }; | |
| } |
This file contains hidden or 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 trampoline(f) { | |
| return function trampolined(...args) { | |
| let result = f.bind(null, ...args); | |
| while (typeof result === 'function') result = result(); | |
| return result; | |
| }; | |
| } |
This file contains hidden or 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
| // Discord all events! | |
| // A quick and dirty fleshing out of the discord.js event listeners (not tested at all!) | |
| // listed here -> https://discord.js.org/#/docs/main/stable/class/Client | |
| // Learn from this, do not just copy it mofo! | |
| // | |
| // Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 | |
| /* | |
| koad-was-here |
This file contains hidden or 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
| 3) Determinar o valor lógico, quando possível, de cada uma das proposições a seguir, mostre o desenvolvimento completo para encontrar a resposta: | |
| a) (r ^ (~q > p)) ^ ~((p <> ~q) > r v ~p) | |
| sabendo que V(p) = F e V(r) = V | |
| (v ^ (~q > F)) ^ ~((F <> ~q) > v v ~F) | |
| (v ^ (~q > F)) ^ ~((F <> ~q) > v v ~F) | |
| q = V | |
| (v ^ (~V > F)) ^ ~((F <> ~V) > v v ~F) |
This file contains hidden or 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
| const tamanhoDa = (lista) => lista.length | |
| const atéEncontrarOTotal = (total, x ) => n => (total += n) <= x | |
| const dividir = (x, y, total = 0) => | |
| tamanhoDa( | |
| crieUmaListaDeTamanho(x) | |
| .ePreenchaCom(y) | |
| .filter( atéEncontrarOTotal(total, x) ) | |
| ) |
This file contains hidden or 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
| const tamanhoDa = (lista) => lista.length | |
| const dividir = (x, y, total = 0) => | |
| tamanhoDa( | |
| crieUmaListaDeTamanho(x) | |
| .ePreenchaCom(y) | |
| .filter( n => (total += n) <= x ) | |
| ) |
This file contains hidden or 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
| const tamanhoDa = (lista) => lista.length | |
| const dividir = (x, y, total = 0) => | |
| tamanhoDa( | |
| crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
| .filter(n => { | |
| total = total + n | |
| return total <= x | |
| }) | |
| ) |
This file contains hidden or 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
| const tamanhoDa = (lista) => lista.length | |
| const dividir = (x, y, passos = 0, total = 0) => { | |
| const lista = crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
| return tamanhoDa(lista.filter(n => { | |
| total = total + n | |
| return total <= x | |
| })) |
This file contains hidden or 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
| const tamanhoDa = (lista) => lista.length | |
| const dividir = (x, y, passos = 0, total = 0) => { | |
| const lista = crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
| const listaFinal = lista.filter(n => { | |
| total = total + n | |
| return total <= x | |
| }) |
This file contains hidden or 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
| // const dividir = (x, y, passos = 0, total = 0) => { | |
| // const lista = crieUmaListaDeTamanho(x).ePreenchaCom(y) | |
| // while(total < x) { | |
| // total += lista[passos] | |
| // passos++ | |
| // } | |
| // return passos |