六角形、112 91バイト
グリッドサイズ6(91バイト)
? { 2 . . <
/ = { * = \ "
. & . . . { _ '
. . { . . } ' * 2
_ } { / . } & . ! "
. > % . . < | . . @ |
\ . . \ . | ~ . . 3
. . " . } . " . "
. & . \ = & / 1
\ = { : = } .
[ = { { { <
コンパクト版
?{2..</={*=\".&...{_'..{..}'*2_}{/.}&.!".>%..<|..@|\..\.|~..3..".}.".".&.\=&/1\={:=}.[={{{<
グリッドサイズ7(112バイト)
? { 2 " ' 2 <
/ { * \ / : \ "
. = . = . = | . 3
/ & / { . . } { . "
. > $ } { { } / = . 1
_ . . } . . _ . . & . {
. > % < . . ~ & . . " . |
| . . } - " . ' . @ | {
. . . = & . . * ! . {
. . . _ . . . _ . =
> 1 . . . . . < [
. . . . . . . .
. . . . . . .
オンラインでお試しください!
コンパクト版:
?{2"'2</{*\/:\".=.=.=|.3/&/{..}{.".>$}{{}/=.1_..}.._..&.{.>%<..~&..".||..}-".'.@|{...=&..*!.{..._..._.=>1.....<[
読みやすくするためのゴルフバージョン:
おおよそのメモリレイアウト
グレーパス(メモリの初期化)
? Read input as integer (Input)
{ Move to memory edge "Divisor left"
2 Set current memory edge to 2
" ' Move to memory edge "Divisor right"
2 Set current memory edge to 2
" Move to memory edge "Multiplier"
3 Set current memory edge to 3
" Move to memory edge "Temp 2"
1 Set current memory edge to 1
{ { { Move to memory edge "Modulo"
= Turn memory pointer around
[ Continue with next instruction pointer
ループエントリー
% Set "Modulo" to Input mod Divisor
< Branch depending on result
グリーンパス(値は2で割り切れます)
} } { Move to memory edge "Result"
= Turn memory pointer around
* Set "Result" to "Temp 2" times "Multiplier" (3)
{ = & Copy "Result" into "Temp2"
{ { } } = Move to "Temp"
: Set "Temp" to Input / Divisor (2)
{ = & Copy "Temp" back to "Input"
" Move back to "Modulo"
赤いパス(値は2で割り切れなくなりました)
} = & " ~ & ' Drag what's left of "Input" along to "Multiplier"
* Multiply "Multiplier" with "Temp 2"
! @ Output result, exit program