Skip to content

Instantly share code, notes, and snippets.

View GabrielModog's full-sized avatar
🤠

Gabriel Tavares GabrielModog

🤠
View GitHub Profile
@GabrielModog
GabrielModog / SortThis.lua
Last active June 23, 2017 02:18
Tiny code in Lua to Sort things... [Not working well]
-- by @GabrielModog -- Tiny code in Lua to Sort things... [Not working well] https://ideone.com/b364bP
array = {93, 11, 33, 53, 71}
--[[
-- New code to test it O(n^2) http://ideone.com/t7uBfE
n = #array
for i = 1, n do
for j = 1, n-1 do
if (array[j] > array[j+1]) then
@GabrielModog
GabrielModog / bubbleSort.c
Last active September 14, 2023 06:40
Sort integers [Not Working]
// by GabrielModog - Sort simple data exercise
#include <stdio.h>
#include <stdlib.h>
int Swap(int left, int right, int array[]){
if(array[left] == 0 || array[right] == 0){
return false;
}
if(array[left] != array[right]){
int temp = array[left];
@GabrielModog
GabrielModog / xingpong.lua
Created June 7, 2017 07:41
-- Short code for my mini-game
-- main.lua Pong by @GabrielModog // in development 07/06/2017
function love.load()
love.graphics.setBackgroundColor(205, 220, 221)
x, y, w, h, xVel = 100, 100, 30, 100, 1
-- There's a pong
-- Function to Draw boxes
function drawBox(x_t, y_t, w_t, h_t, r, g, b)
local ColorRGB = {r, g, b, 80}
love.graphics.setColor (ColorRGB)
love.graphics.rectangle ("fill", x_t, y_t, w_t, h_t )
@GabrielModog
GabrielModog / somethingtoplay.cpp
Last active February 23, 2017 03:57
something with SFML
#include <iostream>
#include <SFML/Graphics.hpp>
int main(int argc, char* argv[]){
/// WINDOW SETEUP
sf::RenderWindow window(sf::VideoMod(1080, 960),"Something to Play", sf::Style::Close | sf::Style::Resize);
/// TEST SOMETHING TO DRAW ON SCREEN
sf::RectangleShape player(sf::Vector2f(100.0f, 100.0f));
player.setFillColor(sf::Color::Red);
player.setOrigin(50.0f, 50.f);
@GabrielModog
GabrielModog / jokenpopo.cc
Created February 23, 2017 03:40
my Joken Po noob game for you.
// Code por GabrielModog - JOKENPOx 0.0.3v
// http://github.com/gabrielmodog
/*
Ideas to adding
- Put some rounds, maximum 3 rounds.
- Organize things that show in console.
- Adding Lizard and Spock.
- Put the code works with graphic interface.
*/