Skip to content

Instantly share code, notes, and snippets.

View r4ai's full-sized avatar
ねむい。

rai r4ai

ねむい。
View GitHub Profile
function selectItem()
for i = 1, 16 do
local item = turtle.getItemDetail(i)
if item ~= nil then
turtle.select(i)
return i
end
end
return nil
end
@r4ai
r4ai / potato.lua
Last active February 28, 2024 05:52
local size = { x = 9, y = 27 }
local seed = "minecraft:potato"
local crop = "minecraft:potatoes"
local grownAge = 7
local function selectFuel()
for i = 1, 16 do
turtle.select(i)
local item = turtle.getItemDetail()
if item and (item.name == "minecraft:coal" or item.name == "minecraft:charcoal") then
@r4ai
r4ai / harvest.lua
Last active February 9, 2024 10:10
local size = { x = 18, y = 18 }
local seed = "minecraft:beetroot_seeds"
local crop = "minecraft:beetroots"
local grownAge = 3
local function selectFuel()
for i = 1, 16 do
turtle.select(i)
local item = turtle.getItemDetail()
if item and (item.name == "minecraft:coal" or item.name == "minecraft:charcoal") then
@r4ai
r4ai / hoge.md
Created December 9, 2023 00:10
hoge

Hello, World!

Sample post for testing purposes.

Bold text
Italic text
Strikethrough text
Inline code
example.com

@r4ai
r4ai / extension.js
Created September 29, 2023 13:47
spec.commonmark.org toc sidebar
var main = function () {
var getElementById = function (id) { var _a; return ((_a = document.getElementById(id)) !== null && _a !== void 0 ? _a : undefined); };
var tocElem = getElementById("TOC");
if (!tocElem) {
throw new Error("TOC element not found");
}
document.body.style.margin = "0 auto";
document.body.style.maxWidth = "68rem";
// create sidebar div
var sidebar = document.createElement("div");
@r4ai
r4ai / .textlintrc.yml
Created May 24, 2023 04:08
textlintの設定ファイルたち
plugins: {}
filters:
comments: true
allowlist:
allow:
# Math
- "/\\$\\$[\\s\\S]*?\\$\\$/m"
- "/\\$([^$]*)\\$/"
@r4ai
r4ai / config.py
Last active May 13, 2023 12:35
keyhacの設定ファイル
import json
import re
import os
# MEMO
# CapsLock → F21
# F21 → 132
def configure(keymap):
@r4ai
r4ai / ocaml-ci.yml
Created May 13, 2023 06:59
OCamlで大学環境のバージョンと最新版でテストが通るか確認するテスト。
name: CI
on:
pull_request:
push:
permissions: read-all
jobs:
build:
open OUnit2
let test_checkl _ =
assert_equal true (checkl 3 [ 1; 2; 3; 4; 5; 6 ]);
assert_equal false (checkl 1 [ 2; 3; 4; 5 ])
let test_dellt _ =
assert_equal [ 1; 2; 3; 4 ] (dellt 0 [ 1; 2; 3; 4 ]);
assert_equal [ 2; 3; 4 ] (dellt 1 [ 1; 2; 3; 4 ]);
assert_equal [ 3; 4 ] (dellt 2 [ 1; 2; 3; 4 ]);
=== 質問 ================================================================
質問: Entity Component Systemについて教えて
回答を聞く人: RustとPythonとjavascriptを普段書いているプロのエンジニア。
注意事項:
1. あいまいな質問に対しては、回答せずに不明点を伝える。
2. 参考文献を必ず3つ以上添える。参考文献が無い場合には回答できない。
3. 回答は箇条書きで行い、結論を先に言う。