Skip to content

Instantly share code, notes, and snippets.

View gaetgu's full-sized avatar

Gabriel Gutierrez gaetgu

View GitHub Profile
@gaetgu
gaetgu / AwokeKnowing Explanation.md
Created March 28, 2021 03:15
Pretty much a story of my life lately, namely how it has been ripped apart...

An explanation of the impossible chess engine.

A while ago (doesn't really matter how long since this is going to take so long to write) a relative showed this website, which was posted (but not created) by a relative. Before you continue reading, go ahead and play around with it. I suck at chess so I can never beat it, and chances are that you will have a hard time, too. This seems fine and dandy, nothing wrong here. Plenty of sites like this exist, lichess, chess.com, sparkchess etc. It really gets interesting once you use the inspect tool.

See if you can figure out where the chess engine or decision-making process is. Can't find it? Use the network tool to make sure that it is not importing another file. Now, view the actual source. This is what I see (might be updated by the time that you see it):

<!doctype html>
<body>
<script>
var track = "".split("#")
print(len(code))
mcode = []
for item in range(len(code)):
mcode.append(list())
mcode[item].append(code[item][0].split(','))
ncode = [[], [], []]
print(len(mcode))
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
setInterval(function () {
document.dispatchEvent((new KeyboardEvent("keydown", {
cancelable: true,
char: " ",
key: " ",
shiftKey: false,
keyCode: 32,
which: 32
})));
setTimeout(function () {
var gen = {
logo: function () {
},
coolify: function(track, mode, options) {
if (mode === "3d") {
var sections = track.split("#");
var normalPeices = sections[0].split(",");
var greyPeices = sections[0].split(",");
var specialPeices = sections[0].split(",");
//stuff
var canceled = false;
var player = GameManager.game.currentScene.playerManager.firstPlayer;
var raceCode = player._scene.races[0].race.code;
var keyToCode = function (key) {
if (key.split("_")[0] == "left") {
return JSON.parse(`{"key":"ArrowLeft","code":"ArrowLeft","location":0,"ctrlKey":false,"shiftKey":false,"altKey":false,"metaKey":false,"repeat":false,"isComposing":false,"charCode":0,"keyCode":37,"which":37,"bubbles":true,"cancelable":true,"type":"${"key" + key.split("_")[1]}"}`)
} else if (key.split("_")[0] === "right") {
return JSON.parse(`{"key":"ArrowRight","code":"ArrowRight","location":0,"ctrlKey":false,"shiftKey":false,"altKey":false,"metaKey":false,"repeat":false,"isComposing":false,"charCode":0,"keyCode":39,"which":39,"bubbles":true,"cancelable":true,"type":"${"key" + key.split("_")[1]}"}`)
} else if (key.split("_")[0] === "up") {
return JSON.parse(`{"key":"ArrowUp","code":"ArrowUp","location":0,"ctrlKey":false,"shiftKey":false,"altKey":false,"metaKey":false,"repeat":false,"isCo
var Track = function () {
this.trackData = {
black: [],
grey: [],
powerUp: []
}
this.insertLine = function (type) {
if (type !== "p" && type !== "s") {
throw "The only supported types are 'p' and 's'.\n'p' is physics line and 's' is scenery line."
}
var time = 0.03;//in seconds
try{document.getElementsByClassName("gameFocusOverlay")[0].click();}catch(e){};
var stopped = true;
for(var i in window['GameManager']['game']['currentScene']['track']['targets']){
if (!stopped) {
window['GameManager']['game']['currentScene']['playerManager']['firstPlayer']['_powerupsConsumed'].targets.push(window['GameManager']['game']['currentScene']['track']['targets'][i]['id']);
}
stopped = false;
@gaetgu
gaetgu / index.html
Created April 10, 2020 15:48
Trial Generator
<html>
<body>
<h3>Enter amount of segments 1-1000, then click Generate.</h3>
<br>
<input type="number" id="inputBox" step=5 placeholder="10" min="1"></input>
<button onclick="generate()" class="a">Generate</button>
<button onCLick="copyCode()" id="copyButton">Copy Code</button>
<br>
<textarea id=output rows=10 cols=50></textarea>
@gaetgu
gaetgu / header-footer-parallax-effect.markdown
Created April 7, 2020 22:57
Header/Footer Parallax Effect
@gaetgu
gaetgu / css-mix-blend-mode-awesome-parallax-scrolling.markdown
Created April 7, 2020 22:56
CSS mix-blend-mode & Awesome Parallax Scrolling