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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Indent</string> | |
<key>scope</key> | |
<string>source.lua</string> | |
<key>settings</key> | |
<dict> |
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
delay(100); | |
randomSeed(micros()); | |
int generator = 0; | |
int primmod = 0; | |
int priv_key = random(1000,10000); | |
void setup() { |
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
//maps pin => interrput number | |
const int INTMAP[] = {-1, -1, 0, 1, -1, -1}; | |
const int COM_SendPin = 2; | |
const int COM_RecPin = 3; | |
const int COM_Timing = 6; | |
const int COM_HalfTiming = 3; | |
void COM_send(uint8_t b) { |
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
#define cs 6 | |
#define dc 7 | |
#define rst 8 // you can also connect this to the Arduino reset | |
#include <Adafruit_GFX.h> // Core graphics library | |
#include <Adafruit_ST7735.h> // Hardware-specific library | |
#include <SPI.h> | |
Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst); |
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 |
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
// 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
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
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; |
OlderNewer