Skip to content

Instantly share code, notes, and snippets.

View ParadoxV5's full-sized avatar
🌻
Google Summer of Code 2024

ParadoxV5

🌻
Google Summer of Code 2024
View GitHub Profile
@ParadoxV5
ParadoxV5 / Wireworld.rb
Last active February 4, 2024 03:41
Ruby Discord Valentine’s Challenge
# frozen_string_literal: true
class CellularAutomaton
def initialize(grid)
@grid = grid
# Back Buffer
@grid2 = grid.map(&:dup)
@rules = yield self
end
def self.load(file, ...) = new(file.each_line(chomp: true).map(&:chars), ...)
def answer1(n) = n.succ
def answer2(str) = str.upcase
def answer3(n) = (0..n).to_a
def answer4 = yield + 42
def answer5(a, b = 1) = a + b
def answer6(n) = n.positive? ? (n - 1) % 9 + 1 : n
def answer7(x) = x.succ
def answer8(n) = n.digits(2).sum
def answer9(s) = s.gsub 'u-g0t-me', 'yikes'
def answer10(x = false) = @data10 = x ? 0 : @data10 ? @data10 + 1 : 1
@ParadoxV5
ParadoxV5 / Symbolic Fibonacci
Created November 28, 2023 05:28
Fibonacci calculator implemented with only `\W`s (and without realizing `Range%` is a block-taking thing)
$* << [//=~'', /$/=~'$'] << () << ->() {
$*[~(/$$/=~'$$')][
( $*[~(/$/=~'$')] += (/$/=~'$') ) - (/$/=~'$')
] ||= (
$*[~(/$/=~'$')] -= (/$$/=~'$$')
$*[~(//=~'')][] + $*[ ~(/$$/=~'$$') ][ $*[~(/$/=~'$')] - (/$$/=~'$$') ]
)
}
# Test

The Hyrulean History as a Singlular Timeline

Preface

The Legend of Zelda games presented gorgeous fantasies of the Hyrulean universe. Regrettably, Nintendo has officially declared that the events of Ocarina of Time fork the timeline into three distinct branches, only one of which develops into the Switch hits. Severing the continuity of the series’s rich lore is poor news for me and other supporters of self-consistent causality.

Fortunately, as the developers abandon the parallel universes and focus on an age over a millennia after the world’s creation, there is enough consistency and timing between the stories to realign the different sequences to a single continuous chronology. The following is my take on the Hyrule history as a singular timeline.

BOARD = {
nil => %q[SCARY?!],
'🎃' => %q[BDEFGH ],
'👻' => %q[IJKLMN'],
'🍬' => %q[OPQTUV,],
'💀' => %q[WXZ.#$:]
}
row = BOARD[nil]
File.foreach 'input.txt', chomp: true do|line|
@ParadoxV5
ParadoxV5 / Arduino.CMakeLists.txt
Last active August 20, 2023 23:00
`CMakeLists.txt` to work with Arduino Sketches in CLion (only IDE insignts, still need Arduino IDE or CLI to build/upload)
cmake_minimum_required(VERSION 3.26)
project("Arduino Sketches")
set(CMAKE_CXX_STANDARD 11)
# Path to Arduino Package
set(ARDUINO [PATH/TO/%LOCALAPPDATA%]/Arduino15/packages/arduino/hardware/avr/1.8.6/)
# Microcontroller
add_compile_definitions(__AVR_ATmega328P__) # Arduino UNO
set(ARDUINO_HARDWARE ${ARDUINO}/hardware/avr/1.8.6/)
@ParadoxV5
ParadoxV5 / index.html
Created August 4, 2023 17:09
a plain HTML boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="styelsheet" href="https://necolas.github.io/normalize.css/8.0.1/normalize.css">
<link rel="stylesheet" href="styles.css">
<script src="script.js"></script>
</head>
<body>

… because Google gave me no results when this curiosity came to me.

Testing method: I generated a .gd script using Ruby’s [Array#permutation] and [Array#product]. Then I let Godot 4.1.0’s code editor (statically?) check for errors. I have not run any of the GDScript.


  • First – Between Variant and anything (i.e. dynamic typing support)
  • Between int, float and bool (Between float and bool? Interesting.)
@ParadoxV5
ParadoxV5 / 砍后鬼灵贼学习笔记.md
Last active May 8, 2024 00:54
砍后鬼灵贼学习笔记(未完待续)

(注:爬天梯肯定没戏啦,摸来益智而已)

随从

核心七随从

正好塞满七个格子;以重要性排列:

  • 魂缚、暗月、鬼灵:必需品,没了就凉办
  1. 鲨鱼:砍后也成了必需品(TODO:沙箱能分担吗?)
  2. 刀油:双连减费