Skip to content

Instantly share code, notes, and snippets.

View benevidesh's full-sized avatar

benevidesh

  • Manaus, Amazonas, Brazil
View GitHub Profile
#!/bin/bash
# ====================CONFIG THIS =============================== #
BACKGROUD_COLOR="#161821" # Background Color
FOREGROUND_COLOR="#c6c8d1" # Text
COLOR_01="#1e2132"
COLOR_02="#e27878"
COLOR_03="#b4be82"
@benevidesh
benevidesh / zn
Last active March 12, 2024 16:10
Zettelkasten Workflow (WIP)
#!/usr/bin/bash
# zn - as zettell
# new export variables EDITOR for your editor and
#+ NOTES for your notes folder.
main () {
note_id=$(date +'%Y%m%d%H%M%S')
$EDITOR $NOTES/"$note_id".md
}
@benevidesh
benevidesh / jogo_nim.py
Last active April 12, 2023 00:24
Minha implementação do jogo Nim (Curso Python USP-Coursera)
def computador_escolhe_jogada(n, m):
computadorRemove = 1
while computadorRemove != m:
if (n - computadorRemove) % (m+1) == 0:
return computadorRemove
else:
computadorRemove += 1
@benevidesh
benevidesh / coeficienteBinomial.py
Created April 25, 2017 20:45
calcular coeficiente binomial
def factorial(x):
fact = count = 1
while count <= x:
fact = fact * count
count += 1
return fact
def coefBinom(n, k):
aux = factorial(n) // (factorial(k) * factorial(n - k))
numeroDoUsuario = int(input('Digite um número: '))
divisor = 2
Primo = True
while divisor < numeroDoUsuario and Primo:
if numeroDoUsuario % divisor == 0:
Primo = False
divisor += 1
numeroDoUsuario = int(input('Digite um número: '))
divisor = 2
Primo = True
while divisor < numeroDoUsuario:
if numeroDoUsuario % divisor == 0:
Primo = False
divisor += 1