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
| # gorgeous text editor made by @GabrielModog 01/10/2017 | |
| from tkinter import * | |
| from tkinter import filedialog | |
| from tkinter.filedialog import asksaveasfile | |
| from tkinter.filedialog import askopenfile | |
| filename = None | |
| def newFile(): | |
| global filename |
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
| -- @GabrielModog in 08/29/2017 17:00 just a pratice. | |
| --[[ | |
| function random_number(n, nmax) | |
| math.randomseed(os.time()) | |
| local random = math.floor(math.random(nmax)) | |
| return random | |
| end | |
| function magic() | |
| local values = random_number(100, 1000) |
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
| -- TODO: A simple game | |
| love.graphics.setDefaultFilter("nearest", "nearest") | |
| love.graphics.setNewFont(15) | |
| local MAX = 150 | |
| function love.load() | |
| listRect = {} | |
| listCircles = {} | |
| end | |
| function createCircles() |
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
| -- LIGHTISH [version 0.1] - @GabrielModg | 09/08/2017 - 04:50 | inspiration by Tron | Love2D 9.2 Engine | |
| function love.load() | |
| love.window.setMode(800, 600) | |
| love.window.setTitle("Ligthish") | |
| love.graphics.setNewFont(15) | |
| debugOn = true | |
| gW = love.graphics.getWidth() | |
| gH = love.graphics.getHeight() | |
| width = gW / 2 - 100 |
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
| -- @GabrielModog || cout <iostream> C++ shit || | |
| cout = function(str) if str ~= nil then io.write(tostring(str), " ") else io.write("\n") end | |
| return cout | |
| end |
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
| rectangle = {area = 0, length = 0, breadth = 0} | |
| function rectangle:new (o, length, breadth) | |
| o = o or {} | |
| setmetatable(o, self) | |
| self.__index = self | |
| self.length = length or 0 | |
| self.breadth = breadth or 0 | |
| self.area = length * breadth | |
| return o |
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
| https://www.quora.com/In-C-or-C++-what-are-your-favorite-pointer-tricks | |
| https://www.codeproject.com/Articles/82880/C-Pointer-Tricks | |
| http://www.ioccc.org/ | |
| https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html | |
| https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html | |
| https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| struct node{ | |
| int x; | |
| struct node *next; | |
| }; | |
| int main(void){ |
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
| #include <stdio.h> | |
| // write by @GabrielModog to some test and experimental shit | |
| typedef struct list_node list_node; | |
| struct list_node{ | |
| list_node *next; | |
| void *data; | |
| }; | |
| #define FOR_EACH(item, list)\ |
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
| -- @GabrielModog -- Swap the first number in array to the last one. | |
| arr = {15, 3, 4, 7, 11} | |
| i = 1 | |
| last = #arr | |
| if arr[i] < arr[last] then | |
| arr[i], arr[last] = arr[last], arr[i] | |
| goto done |