Skip to content

Instantly share code, notes, and snippets.

View Alynva's full-sized avatar
🤔
Thinking

Alisson Nunes Alynva

🤔
Thinking
View GitHub Profile
@Alynva
Alynva / teste_fps.cpp
Created June 1, 2017 11:31
Um código simples pra testar o framerate no SDL
#include "SDL2/SDL.h"
#include <stdio.h>
// How many frames time values to keep
// The higher the value the smoother the result is...
// Don't make it 0 or less :)
#define FRAME_VALUES 10
// An array to store frame times:
Uint32 frametimes[FRAME_VALUES];
@Alynva
Alynva / GeoA.h
Last active June 27, 2017 18:39
Uma biblioteca de geometria, adaptada da p5.js (JavaScript) para C++.
#ifndef __Geometria_Alynva__
#define __Geometria_Alynva__
namespace GeoA {
const double TWO_PI = 6.28318530717958647693;
const double PI = 3.14159265358979323846;
const double HALF_PI = 1.57079632679489661923;
const double QUARTER_PI = 0.7853982;
double random(); // [0.0 .. 1.0]
@Alynva
Alynva / letreiro.cpp
Last active June 25, 2017 22:37
Um programa louco feito em alguma madrugada qualquer
#include <iostream>
#include <map>
#include <windows.h>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
// Move o ponteiro de escrita
@Alynva
Alynva / data_structures.h
Last active July 1, 2017 05:14 — forked from sp0oks/data_structures.h
Abstract data types library for C++
/*My personal project of a library that includes different types of template container structures.
Basically a rework of C++'s STL.
It is an open source project and so if you feel like contributing to it(testing, fixing and/or adding new stuff) just send me an
email with the subject "data structures gist contribution" listing what you did or want to do and I'll have it added with due
credit (just check my profile for the email address).
Biblioteca criada para o uso de diferentes tipos abstratos de dados dinâmicos,
partindo do conceito de listas encadeadas para posterior reuso em projetos.
@Alynva
Alynva / jogo-da-velha-2.c
Last active July 13, 2017 12:40
Um jogo da velha simples utilizando CGI
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
// Declaração de variáveis
char *dado = NULL;
char tabuleiro[3][3];
// Inicialização do tabuleiro
tabuleiro[0][0] = '-'; tabuleiro[0][1] = '-'; tabuleiro[0][2] = '-';
@Alynva
Alynva / match.cpp
Last active November 9, 2017 14:11
Analisa duas listas de stings ORDENADAS e retorna outra lista que contém as strings que pertence simultaneamente às duas listas fornecidas.
/*
Autor:
Alisson Nunes V. A. (www.alynva.com)
Descrição:
Este algoritmo foi desenvolvido com
o propósito de analisar duas listas de
stings ORDENADAS e retornar outra lista
que contém as strings que pertence
simultaneamente às duas listas
@Alynva
Alynva / setInterval.kt
Created September 19, 2018 17:15
setInterval in Kotlin
val handler = Handler(Looper.getMainLooper())
val runnable = object : Runnable {
override fun run() {
if (countProgress.progress > 0) {
val new_time = countProgress.progress.toInt() - 1
timeLabel.text = "$new_time segundos"
countProgress.progress = new_time
}
handler.postDelayed(this, 1000)
@Alynva
Alynva / busy_cop-mapa1.pl
Last active November 8, 2018 20:38
Trabalho de Inteligência Artificial - Projeto 1 (BCC/UFSCar/2018)
% Trabalho de Inteligência Artificial - Projeto 1 (BCC/UFSCar/2018)
% Autor: Alisson Nunes (R.A.: 725862)
:- write_ln('[MAPA 1 CARREGADO]').
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ladrao([10, 5]) :- !.
policial([10, 1]) :- !.
const keyCodes = {
0: 'That key has no keycode',
3: 'break',
8: 'backspace / delete',
9: 'tab',
12: 'clear',
13: 'enter',
16: 'shift',
17: 'ctrl',
18: 'alt',
This file has been truncated, but you can view the full file.