[過去ログ]
プログラミングのお題スレ Part13 (1002レス)
プログラミングのお題スレ Part13 http://mevius.5ch.net/test/read.cgi/tech/1549160513/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
750: デフォルトの名無しさん [sage] 2019/03/22(金) 12:12:43.26 ID:bmKj2SZK >>746 Squeak Smalltalk | fn | fn := [:str | | map range sign goal position next atEnd | map := str lines collect: [:line | line subStrings collect: #asInteger]. range := 1@1 extent: map first size @ map size. sign := (0 asPoint fourNeighbors with: #(→ ↓ ← ↑) collect: #->) as: Dictionary. goal := #★. position := 1@1. next := 2. atEnd := false. [atEnd] whileFalse: [ | found | found := position fourNeighbors detect: [:neighPos | (range containsPoint: neighPos) and: [((map at: neighPos y) at: neighPos x) = next] ] ifNone: [atEnd := true. Float nan]. (map at: position y) at: position x put: (sign at: found - position ifAbsent: goal). position := found. next := next + 1. ]. (map collect: #join) asStringWithCr ]. fn value: '1 4 5 6 2 3 8 7 15 14 9 10 16 13 12 11' "=> '↓→→↓ →↑↓← ↓←→↓ ★↑←←' " http://mevius.5ch.net/test/read.cgi/tech/1549160513/750
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 252 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.023s