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
#include <stdio.h> | |
/** | |
* Imprime um array de inteiros. | |
*/ | |
void print_array_int(long long *lst, long long size) | |
{ | |
printf("{"); | |
// Itera sobre todos os elementos, menos o último |
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
#include <stdio.h> | |
#include <math.h> | |
#include <string.h> | |
/** | |
* Aplica a cifra de César na string de entrada. | |
* | |
* Modifica o argumento durante a aplicação. | |
*/ |
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
#include <stdio.h> | |
#include <math.h> | |
double PI = 3.14; | |
int fat(int n) { | |
if (n == 0) { | |
return 1; | |
} | |
else { |
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
#!/usr/bin/env python | |
"""Django's command-line utility for administrative tasks.""" | |
import os | |
import sys | |
def main(): | |
"""Run administrative tasks.""" | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') | |
try: |
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
import pyxel | |
from copy import deepcopy | |
LARGURA = 80 | |
ALTURA = 60 | |
# Liga/desliga simulação | |
pausa = True | |
# Tabuleiro de booleanos mostrando as células preenchidas |
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
import pyxel | |
from copy import deepcopy | |
LARGURA = 80 | |
ALTURA = 60 | |
# Liga/desliga simulação | |
pausa = True | |
# Tabuleiro de booleanos mostrando as células preenchidas |
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
# DICA: Lembre-se de criar um arquivo leaderboard.txt, | |
# caso ele não exista! | |
# Lê arquivo com recordes | |
with open("leaderboard.txt", "r") as arquivo: | |
recordes = [] | |
for linha in arquivo: | |
nome, _sep, valor = linha.rpartition(':') | |
recordes.append((nome, int(valor))) |
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
import pyxel | |
# Constantes | |
RAIO = 2 | |
ALTURA = 12 # altura de cada pá | |
LARGURA = 2 # largura de cada pá | |
P1_X = 3 | |
P2_X = 120 - 3 | |
FPS = 30 | |
dt = 1 / FPS |
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
import pyxel | |
from random import randint | |
# Declara variáveis globais | |
# Posição e velocidade | |
x = 20 | |
y = 40 | |
vy = -20 |
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
from random import choice | |
""" | |
intro : PLANETA em SIGNO <apontamento> | |
apontamento : VERBO_APTO sorte. | |
sorte : você terá SORTE AREA_DA_VIDA | |
| <sorte>, mas <sorte> | |
| <sorte> e também <sorte> | |
continuacao : "Cuidado com novas amizades, pois Marte e Mercúrio opostos sinalizam conflitos para o signo de Cancer." | |
""" |
NewerOlder