Hunt The Wumpus/APL: Difference between revisions

m
Removed duplicate header.
(GNU APL version of Hunt the Wumpus)
 
m (Removed duplicate header.)
 
(2 intermediate revisions by 2 users not shown)
Line 1:
{{collection|Hunt_The_Wumpus}}
 
=={{header|APL}}==
{{works with|GNU APL}}
 
<langsyntaxhighlight APLlang="apl">#!/usr/local/bin/apl --script -f --
 
⍝ Unfortunately, GNU APL does not support ⍞-input in script mode very well
Line 53 ⟶ 52:
c←c⍪⊃(5 12 17)(6 11 18)(7 14 18)(8 13 19)(9 16 17)
c←c⍪⊃(10 15 19)(11 20 15)(12 13 20)(14 16 20)(17 18 19)
 
∇initPRNG
⍝⍝ Seed the internal PRNG used by APL ? operator
⎕rl ← +/ ⎕ts ⍝⍝ Not great... but good enough
 
Line 70 ⟶ 74:
⍝⍝ Initialization
⎕rl←(2*32)|×/⎕tsinitPRNG ⍝ Initialize random seed from time
arrows←5 ⍝ Start with 5 arrows
rooms←20/0 ⍝ 20 empty rooms
Line 158 ⟶ 162:
)OFF
</syntaxhighlight>
</lang>
9,479

edits