Skip to content

Instantly share code, notes, and snippets.

View CaineArdayfio's full-sized avatar
💻
GRIND—GRIND—GRIND

Caine CaineArdayfio

💻
GRIND—GRIND—GRIND
View GitHub Profile
@CaineArdayfio
CaineArdayfio / prompt.txt
Created September 14, 2023 19:48
Natural Language Intent Interpretation Prompt
Speech:Give me a small green cube.
CODE:{"createObj":{"objectType":"cube","objectColor":"0,1,0","objectSize":"0.1, 0.1,0.1","objectPosition":"0,0,0","objectSource":"primitive"}}
###
Speech:Create a big orange sphere.
CODE:{"createObj":{"objectType":"sphere","objectColor":"1,0.5,0","objectSize":"1,1,1","objectPosition":"0,0,0","objectSource":"primitive"}}
###
Speech:Create a block of cheese.
CODE:{"createObj":{"objectType":"Cheese","objectColor":"","objectSize":"0.5,0.5,0.5","objectPosition":"0,0,0","objectSource":"prefab"}}
###
Speech:Create a gold coin.
@CaineArdayfio
CaineArdayfio / grammar.g4
Created September 14, 2023 19:46
For reproducibility, the grammar of AtomScript is defined below in G4 file format (used to define grammars for ATNLR4).
grammar Hello;
program: line* EOF;
line: statement | ifBlock | foreverBlock | onStartBlock | onCollisionBlock | onButtonPressBlock;
statement: (assignment | functionCall) ';';
ifBlock: 'if' expression block ('else' elseIfBlock)?;
@CaineArdayfio
CaineArdayfio / line_break.py
Last active March 11, 2023 07:57
Find optimal places to put line breaks in a passage based on a "preferred" number of characters/line, M.
### Find optimal places to put line breaks in a passage based on a "preferred" number of characters/line, M. ###
WORDS = "Determine the minimal penalty, and corresponding optimal division of words into lines, for the text of this question, from the first `Determine' through the last `correctly.)', for the cases where M is 40 and M is 72. Words are divided only by spaces (and, in the pdf version, linebreaks) and each character that isn't a space (or a linebreak) counts as part of the length of a word, so the last word of the question has length eleven, which counts the period and the right parenthesis. (You can find the answer by whatever method you like, but we recommend coding your algorithm from the previous part. You don't need to submit code.) (The text of the problem may be easier to copy-paste from the tex source than from the pdf. If you copy-paste from the pdf, check that all the characters show up correctly.)"
WORDS = WORDS.split(" ")
# number of characters/line
M = 72
# M=40 -> minPenalty = 396, M
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_I2CRegister.h>
#include <Adafruit_SPIDevice.h>
/*********
Complete project details at https://randomnerdtutorials.com
This is an example for our Monochrome OLEDs based on SSD1306 drivers. Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98
This example is for a 128x32 pixel display using I2C to communicate 3 pins are required to interface (two I2C and one reset).
@CaineArdayfio
CaineArdayfio / Cricket Display
Created December 21, 2022 13:50
Shows a graphic of a cricket
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_I2CRegister.h>
#include <Adafruit_SPIDevice.h>
/*********
Complete project details at https://randomnerdtutorials.com
This is an example for our Monochrome OLEDs based on SSD1306 drivers. Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98
This example is for a 128x32 pixel display using I2C to communicate 3 pins are required to interface (two I2C and one reset).
#include <Adafruit_BusIO_Register.h>
#include <Adafruit_I2CDevice.h>
#include <Adafruit_I2CRegister.h>
#include <Adafruit_SPIDevice.h>
/*********
Complete project details at https://randomnerdtutorials.com
This is an example for our Monochrome OLEDs based on SSD1306 drivers. Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98
This example is for a 128x32 pixel display using I2C to communicate 3 pins are required to interface (two I2C and one reset).
@CaineArdayfio
CaineArdayfio / index.html
Last active December 13, 2022 08:28
Button + D3.js
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>JavaScript + Serial Monitor = &#128150;</title>
<!-- JavaScript files -->
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
</head>
<body>
@CaineArdayfio
CaineArdayfio / index.html
Created October 10, 2022 02:35
Bootstrap Intro
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>