Skip to content

Instantly share code, notes, and snippets.

@yonta
yonta / original.md
Last active March 31, 2024 17:35
Spawn Rules of Minecraft in Bedrock Edition

Spawn cycle

Bedrock Edition

Natural spawning in Bedrock Edition shares only a few similarities to natural spawning in Java Edition. In Bedrock Edition, there are two main types of natural spawns: pack spawns and structure mob spawns. Structure mob spawns are mobs spawned as part of a structure, such as nether fortresses, witch huts, etc. Pack spawns account for all other types of natural spawns, including mobs that spawn individually (i.e. not in a pack of 2 or more). Both types of natural spawns follow the same rules for spawn conditions and the mob cap.

@yonta
yonta / init.el
Last active April 23, 2019 23:20
;; ivy-richが提供する変数、一部省略
;; この先頭に(#'counsel-switch-buffer A)を足したい
(defcustom ivy-rich-display-transformers-list
'(ivy-switch-buffer
(...) ; A
counsel-M-x
(...)
counsel-describe-function
(...)
counsel-describe-variable
@yonta
yonta / test.el
Created May 9, 2019 12:30
test file
(defvar test-var 1)
(symbol-value 'test-var)
;; => 1
(defun f () test-var)
(symbol-function 'f)
;; => (lambda nil test-var)
(f)
@yonta
yonta / EmacsLisp.el
Last active June 12, 2019 15:45
let-if
(let* ((a (...))
(a (if cond a (f a)))
(a (...)))
g a)
@yonta
yonta / lisp-sort.el
Last active June 13, 2019 07:27
Lisp Sort
(let ((a (list 2 1)))
(sort a #'<)
a)
;; => (2)
(let ((a (list 1 2)))
(sort a #'<)
a)
;; => (1 2)
@yonta
yonta / fizzbuzz.sml
Last active June 20, 2019 07:33
Added FizzBuzz
(*
* A original problem is here.
* https://twitter.com/kokuyouwind/status/1141602930019061760
*)
fun fizzBuzz n =
let
val div3 = n mod 3 = 0
val div5 = n mod 5 = 0
in
@yonta
yonta / StalinSort.sml
Last active July 30, 2019 16:11
粛清だ
fun stalinSort nil = nil
| stalinSort (h::t) =
let
fun sort _ nil = nil
| sort x (h::t) =
if x < h then h :: sort h t
else sort x t
in
h :: sort h t
end
;; (setq lexical-binding nil)
;;; 任意のregionを使う関数を、選択regionがないときは現在行を与えるようにする
(defun call-with-region-or-line (func)
""
(lambda () (interactive)
(if (region-active-p) (call-interactively func)
(let ((begin (line-beginning-position))
(end (1+ (line-end-position))))
(funcall func begin end)))))
;;; 結局採用したやつ
(defun call-with-region-or-line (func-symbol)
"Call FUNC-SYMBOL with marked region or current line.
If the region is active, beggining and end of region is used for the function
arguments, othewise current line is used."
(if (region-active-p)
(funcall func-symbol (region-beginning) (region-end))
(let* ((begin (line-beginning-position))
(end (1+ (line-end-position))))
@yonta
yonta / recipe.md
Last active August 30, 2023 15:37
芋煮会の準備手順

山形芋煮

材料の下ごしらえ

  1. ネギとごぼうを切って、それぞれ別袋にいれておく

会場

  1. 鍋の外側に液体洗剤を塗る(同時に火をつけ始める)
  2. 鍋に水を1/2~2/3にいれて火にかける