James came up with a very interesting stitch. I like the small size of the program, and I especially like the maze generation. I also like the idea or challenge. It triggers one's imagination. I'm sorry that instead of solutions, there was more negative criticism about compressed coding.
I tried to expand as James gave up the lesson. The code is sometimes not practical anymore, but due to the small number of characters, I tried to compress everything as much as I could. This is hard to understand even for me, but it works and serves the purpose. It has neither IF nor SELECT. In fact, the entire program could be arranged in a single line.
I hope sufficiently scandalous!
Thanks James for the idea!
(control wasd or numeric keys. survive and collect the golds)
I tried to expand as James gave up the lesson. The code is sometimes not practical anymore, but due to the small number of characters, I tried to compress everything as much as I could. This is hard to understand even for me, but it works and serves the purpose. It has neither IF nor SELECT. In fact, the entire program could be arranged in a single line.
I hope sufficiently scandalous!

(control wasd or numeric keys. survive and collect the golds)
Code: (Select All)
en = 3: gold = 12: c0 = 219: c1 = 46: c2 = 36: c3 = 35: c4 = 2 'en=enemies gold=golds 'c0,c1,c2,c3,c4 wall,street,gold,enemi,iam - ascii code of characters in order
Randomize Timer: r(0) = 80: r(1) = 40: For t = 0 To 1: r(2 + t) = Int(r(t) / 2): p(t) = r(2 + t): d(t) = p(t): Next t: Screen _NewImage(r(0), r(1), 0): _FullScreen: _ControlChr Off: Color 6: For d = 1 To 800
m$ = m$ + Chr$(48 + Int(Rnd * 4)): Next d: _PrintString (1, 1), String$(r(0) * r(1), Chr$(c0)): For c = 1 To Len(m$): _PrintString (d(0), d(1)), Chr$(c1): t = Val(Mid$(m$, c, 1)): f = 0: For a = 0 To 1: b = a * 2: l = t = b + 1
d(a) = (t = b Or l) * (l * 2 + 1) + d(a): f = f Or d(a) = 1 Or d(a) = r(a) - 1: Next a: For t = 0 To 1: d(t) = r(t + 2) * -f + d(t) * (-f Xor 1): Next t: Next c: Color 14: For c = 1 To gold: Do: For t = 0 To 1
g(t) = Int((r(t) - 10) * Rnd) + 5: Next t: Loop While Screen(g(1), g(0), 0) <> c1 Or g(0) = r(2): _PrintString (g(0), g(1)), Chr$(c2): Next c: For c = 0 To en - 1: Do: For t = 0 To 1: en(c, t) = Int((r(t) - 10) * Rnd) + 5
Next t: Loop Until Screen(en(c, 1), en(c, 0), 0) = c1 And Screen(en(c, 1), en(c, 0) + 1, 0) = c0: Next c: Do: mygold = mygold - (Screen(p(1), p(0), 0) = c2): Color 15: _PrintString (p(0), p(1)), Chr$(c4): m = 0
k$ = LCase$(InKey$): m(0) = p(0): m(1) = p(1): For t = 0 To 3: e = ((t And 1) * 2 - 1) * (Mid$("dasw", t + 1, 1) = k$ Or Mid$("6428", t + 1, 1) = k$): q = Sgn(t And 2): m(q) = e + m(q): m = m Or e: Next t
c = Abs(m And Screen(m(1), m(0), 0) <> c0): Color 6: _PrintString (p(0), p(1)), Mid$(Chr$(c1), 1, c): For t = 0 To 1: p(t) = m(t) * c + p(t) * (c Xor 1): Next t: For c = 0 To en - 1: die = die Or Screen(en(c, 1), en(c, 0), 0) = c4
t = en(c, 2) + 2: Do: t = t - 1: For w = 0 To 1: b = (t + 16 + w) Mod 4: d(w) = en(c, w) - ((b And 1) = 0) * ((b = 0) * 2 + 1): Next w: u = Screen(d(1), d(0), 0): Loop Until u <> c0: Color 6
_PrintString (en(c, 0), en(c, 1)), Mid$(Chr$(c1), 1, en(c, 3)): en(c, 0) = d(0): en(c, 1) = d(1): en(c, 2) = t: en(c, 3) = -(u = c1): Color 2: _PrintString (d(0), d(1)), Mid$(Chr$(c3), 1, en(c, 3))
die = die Or (u = c4) Or (m(0) = en(c, 0) And m(1) = en(c, 1)): Next c: _Limit 12: Loop Until k$ = Chr$(27) Or gold = mygold Or die: Color 15: Print Left$("you dead", -8 * die); Left$("congratulation!", -15 * (gold = mygold))