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/lua | |
local tracked_url = "http://www.roblox.com/Forum/User/MyForums.aspx" | |
local base_url = "http://www.roblox.com/Forum/ShowPost.aspx?PostID=" | |
local cookie = "(Paste your .ROBLOSECURITY cookie which you can find in your browser cookies, don't share this script with it still pasted in there obviously)" | |
function cmd(txt) | |
os.execute(txt) | |
end |
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
ZERO = 0 | |
ONE = 1 | |
EITHER = 2 | |
nvars = 4 | |
varnames = ['a', 'b', 'c', 'd'] | |
func = lambda a,b,c,d: (a and b) or (c and d) |
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 random | |
graph = [ | |
(0,0), | |
(20,0), | |
(20,20), | |
(0,20), | |
] | |
#add some random points |
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 builtins | |
############################################################################### | |
#From SO: http://stackoverflow.com/questions/1988804/ | |
class Memoize: | |
def __init__(self, f): | |
self.f = f |
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
struct Card { | |
CardColor Color; | |
CardSuit Suit; | |
CardValue Value; | |
// | |
bool FaceUp; | |
// | |
Card* Next; | |
Card* Prev; |
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
struct Card { | |
CardColor Color; | |
CardSuit Suit; | |
CardValue Value; | |
// | |
bool FaceUp; | |
// | |
Card* Next; | |
Card* Prev; |
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
class PackedRestaurantRecord { | |
public: | |
//MAD BIT TWIDDLING ~~~ AVERT YOUR GAZE! | |
uint8_t getBlockNum() { | |
return (C & 0x0F) | (D & 0xF0); | |
} | |
void setBlockNum(uint8_t n) { | |
C = (C & 0xF0) | (n & 0x0F); | |
D = (D & 0x0F) | (n & 0xF0); | |
} |
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
// x, y, w, h specify what region of the screen to update. | |
// mZoom specifies the zoom level to draw the map at (1 = 1:1, 2 = only every other pixel is shown, etc) | |
// mOriginX/Y specifies what position on the map is currently at the screen's top right corner. | |
void draw(int32_t x, int32_t y, int32_t w, int32_t h) { | |
tft.setAddrWindow(x, y, x+w-1, y+h-1); | |
// | |
x *= mZoom; | |
y *= mZoom; | |
x += mOriginX; |
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
/* Simple Image Drawing | |
* | |
* Draws an image to the screen. The image is stored in "parrot.lcd" on | |
* the SD card. The image file contains only raw pixel byte-pairs. | |
*/ | |
#include <Adafruit_GFX.h> // Core graphics library | |
#include <Adafruit_ST7735.h> // Hardware-specific library | |
#include <SPI.h> | |
#include <SD.h> |
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
local Terrain = game.Workspace.Terrain | |
--==========================================================================================================-- | |
-- Persistent noise generation code ==-- | |
--==========================================================================================================-- | |
-- | |
-- Generating perlin noise is the most expensive part of the terrain generation. It is also however, totally | |
-- predictable, so we can pre-generate most of the perlin noise that we will need before the main terrain |