Switch to edit mode.
Name(s): description1: "Copyright (C) Olivier Beaton (aka Quadir), all rights reserved."
2: "Licensed under BSD, see http://www.opensource.org/licenses/bsd-license.php"
3: ""
4: "Syntax:"
5: " :description()"
6: "--"
7: "Return a formatted playing board."
8: if (this.generic == this)
9: return pass(@args)
10: endif
11: chip1 = this.msg_chip1
12: chip2 = this.msg_chip2
13: nochip = this.msg_nochip
14: desc = {}
15: desc = {@desc, tostr(" _<font color=", this.msg_col, ">", @$list_utils:intersperse($list_utils:range(1, this.width), tostr("</font>_ _<font color=", this.msg_col, ">")), "</font>_ ")}
16: grid = this.grid
17: for row in (grid)
18: for cell in [1..length(row)]
19: row[cell] = `{chip1, chip2}[row[cell]] ! E_RANGE => nochip'
20: endfor
21: row = $list_utils:intersperse(row, " | ")
22: desc = {@desc, tostr("| ", @row, " |")}
23: desc = {@desc, tostr("+", $su:space(this.width * 2 * 2, "---+"))}
24: endfor
25: desc = {@desc, $su:center(tostr($su:capitalize($su:english_number(this.connect)), " connected wins."), this.width * 2 * 2 + 1)}
26: if (this.width != 7 || this.height != 6 || this.connect != 4)
27: desc = {@desc, "Non Regulation Board"}
28: endif
29: desc = {@desc, ""}
30: desc = {@desc, tostr("It is player ", this.player, "'s turn.")}
31: desc = {@desc, tostr("[ ", chip1, " ] is player 1.")}
32: desc = {@desc, tostr("[ ", chip2, " ] is player 2.")}
33: desc = {@desc, tostr("[ ", nochip, " ] is a blank space.")}
34: return desc
35: "Last modified by Quadir (#9780) on Mon Sep 23 11:25:43 2002 MDT."