aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gs/contribs
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/gs/contribs
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/gs/contribs')
-rw-r--r--lib/gs/contribs/Makefile31
-rw-r--r--lib/gs/contribs/bonk/Makefile108
-rw-r--r--lib/gs/contribs/bonk/bitmaps/bonkbomb66
-rw-r--r--lib/gs/contribs/bonk/bitmaps/bonkface66
-rw-r--r--lib/gs/contribs/bonk/bitmaps/bonklogo320
-rw-r--r--lib/gs/contribs/bonk/bitmaps/bonkmiss66
-rw-r--r--lib/gs/contribs/bonk/bitmaps/bonktom66
-rw-r--r--lib/gs/contribs/bonk/bitmaps/bonkx66
-rw-r--r--lib/gs/contribs/bonk/bitmaps/erl-e106
-rw-r--r--lib/gs/contribs/bonk/bitmaps/erl-text106
-rw-r--r--lib/gs/contribs/bonk/bonk.erl579
-rw-r--r--lib/gs/contribs/bonk/bonk.gifbin0 -> 196 bytes
-rw-r--r--lib/gs/contribs/bonk/bonk.tool6
-rw-r--r--lib/gs/contribs/bonk/bonk.txt30
-rw-r--r--lib/gs/contribs/bonk/bonk_sound.erl81
-rw-r--r--lib/gs/contribs/bonk/bonk_square.erl145
-rw-r--r--lib/gs/contribs/bonk/sounder.erl159
-rw-r--r--lib/gs/contribs/bonk/sounds/bonk.aubin0 -> 2008 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/damn.aubin0 -> 3744 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/explosion.aubin0 -> 7708 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/gameover.aubin0 -> 5986 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/hehee.aubin0 -> 3772 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/level.aubin0 -> 5360 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/missedme.aubin0 -> 2735 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/music.aubin0 -> 48072 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/ouch!!!.aubin0 -> 2342 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/praisejesus.aubin0 -> 16730 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/trumpet.aubin0 -> 49332 bytes
-rw-r--r--lib/gs/contribs/bonk/sounds/yes.aubin0 -> 4400 bytes
-rw-r--r--lib/gs/contribs/cols/Makefile102
-rw-r--r--lib/gs/contribs/cols/cols.erl618
-rw-r--r--lib/gs/contribs/cols/cols.gifbin0 -> 185 bytes
-rw-r--r--lib/gs/contribs/cols/cols.tool5
-rw-r--r--lib/gs/contribs/cols/help.gifbin0 -> 172 bytes
-rw-r--r--lib/gs/contribs/cols/highscore.erl95
-rw-r--r--lib/gs/contribs/ebin/.gitignore0
-rw-r--r--lib/gs/contribs/mandel/Makefile100
-rw-r--r--lib/gs/contribs/mandel/mandel.erl345
-rw-r--r--lib/gs/contribs/mandel/mandel.gifbin0 -> 394 bytes
-rw-r--r--lib/gs/contribs/mandel/mandel.html73
-rw-r--r--lib/gs/contribs/mandel/mandel.tool6
-rw-r--r--lib/gs/contribs/othello/Makefile100
-rw-r--r--lib/gs/contribs/othello/othello.erl236
-rw-r--r--lib/gs/contribs/othello/othello.gifbin0 -> 148 bytes
-rw-r--r--lib/gs/contribs/othello/othello.tool6
-rw-r--r--lib/gs/contribs/othello/othello_adt.erl539
-rw-r--r--lib/gs/contribs/othello/othello_board.erl642
-rw-r--r--lib/gs/contribs/othello/priv/marker.bm43
-rw-r--r--lib/gs/contribs/othello/priv/square.bm43
49 files changed, 4954 insertions, 0 deletions
diff --git a/lib/gs/contribs/Makefile b/lib/gs/contribs/Makefile
new file mode 100644
index 0000000000..9aecaff44f
--- /dev/null
+++ b/lib/gs/contribs/Makefile
@@ -0,0 +1,31 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+#
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+SUB_DIRECTORIES = bonk cols mandel othello
+SPECIAL_TARGETS =
+
+#
+# Default Subdir Targets
+#
+include $(ERL_TOP)/make/otp_subdir.mk
+
diff --git a/lib/gs/contribs/bonk/Makefile b/lib/gs/contribs/bonk/Makefile
new file mode 100644
index 0000000000..be096824dd
--- /dev/null
+++ b/lib/gs/contribs/bonk/Makefile
@@ -0,0 +1,108 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+#
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../../vsn.mk
+VSN=$(GS_VSN)
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/lib/gs-$(VSN)/contribs
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+MODULES= \
+ bonk \
+ bonk_sound \
+ bonk_square \
+ sounder
+
+HRL_FILES=
+ERL_FILES= $(MODULES:%=%.erl)
+
+TARGET_FILES= $(MODULES:%=../ebin/%.$(EMULATOR)) $(TARGET_TOOLBOX_FILES)
+
+BITMAPS= bitmaps/bonkbomb bitmaps/bonkface bitmaps/bonklogo bitmaps/bonkmiss \
+ bitmaps/bonktom bitmaps/bonkx bitmaps/erl-e bitmaps/erl-text
+SOUNDS= sounds/bonk.au sounds/damn.au sounds/explosion.au sounds/gameover.au \
+ sounds/hehee.au sounds/level.au sounds/missedme.au sounds/music.au \
+ sounds/ouch!!!.au sounds/praisejesus.au sounds/trumpet.au sounds/yes.au
+
+TOOLNAME = bonk
+
+EXTRA_FILES= $(TOOLNAME).txt
+TOOLBOX_FILES= $(TOOLNAME).tool $(TOOLNAME).gif
+TARGET_TOOLBOX_FILES= $(TOOLBOX_FILES:%=$(EBIN)/%)
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+ERL_COMPILE_FLAGS +=
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+
+debug opt: $(TARGET_FILES)
+
+docs:
+
+clean:
+ rm -f $(TARGET_FILES)
+ rm -f core
+
+# ----------------------------------------------------
+# Special Build Targets
+# ----------------------------------------------------
+
+$(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif
+ rm -f $@
+ cp $(TOOLNAME).gif $@
+
+$(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool
+ rm -f $@
+ cp $(TOOLNAME).tool $@
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_spec: opt
+ $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) $(RELSYSDIR)/bonk/bitmaps
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/bonk/bitmaps
+ $(INSTALL_DIR) $(RELSYSDIR)/bonk/sounds
+ $(INSTALL_DATA) $(SOUNDS) $(RELSYSDIR)/bonk/sounds
+ $(INSTALL_DIR) $(RELSYSDIR)/bonk
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/bonk
+
+
+release_docs_spec:
+
diff --git a/lib/gs/contribs/bonk/bitmaps/bonkbomb b/lib/gs/contribs/bonk/bitmaps/bonkbomb
new file mode 100644
index 0000000000..8b121db9e8
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/bonkbomb
@@ -0,0 +1,66 @@
+#define bonkbomb_width 75
+#define bonkbomb_height 75
+static char bonkbomb_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x10, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x10, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x21,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x11, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x90, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x90, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x51, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18,
+ 0x12, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x94, 0x18,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x41, 0x06, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xbb, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x99, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x18, 0x19,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x62, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x84, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x31, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0x3b, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1f, 0x40,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xb8, 0x0e, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x5c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0xaf, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+ 0xff, 0x57, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xaf,
+ 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x5f, 0x1d, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xbf, 0x0e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfe, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0xff, 0xff, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x7f, 0xfc, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0x3f, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x0f, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0xc0,
+ 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xf0, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xf8, 0xff, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0xff, 0xfd, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
+ 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+ 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/bonk/bitmaps/bonkface b/lib/gs/contribs/bonk/bitmaps/bonkface
new file mode 100644
index 0000000000..964fb93098
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/bonkface
@@ -0,0 +1,66 @@
+#define bonkface_width 75
+#define bonkface_height 75
+static char bonkface_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x3c, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00,
+ 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08,
+ 0x00, 0x80, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x60,
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0x18, 0x00, 0x08,
+ 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x03, 0x06, 0x00, 0x0f, 0x00, 0x00,
+ 0x00, 0x40, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x17, 0x00, 0x00, 0x00, 0x40,
+ 0xfe, 0x1f, 0x00, 0xc0, 0xff, 0x13, 0x00, 0x00, 0x00, 0x20, 0xf8, 0xff,
+ 0x03, 0xfe, 0xff, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xff, 0xff, 0xff,
+ 0x7f, 0x20, 0x00, 0x00, 0x00, 0x20, 0xc0, 0xff, 0xdf, 0xff, 0x1f, 0x20,
+ 0x00, 0x00, 0x00, 0x20, 0x00, 0xff, 0xdf, 0xff, 0x07, 0x20, 0x00, 0x00,
+ 0x00, 0x10, 0x00, 0xfe, 0x8f, 0xff, 0x03, 0x40, 0x00, 0x00, 0x00, 0x10,
+ 0x00, 0xf8, 0x8f, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0xf0,
+ 0x07, 0x7f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0xc0, 0x07, 0x1f,
+ 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x03, 0x06, 0x00, 0x40,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0xe0,
+ 0x00, 0x38, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x10, 0xf0, 0x01, 0x7c,
+ 0x40, 0x40, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x06, 0x03, 0x40, 0x40,
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0xf8, 0x00, 0x40, 0x40, 0x00, 0x00,
+ 0x00, 0x10, 0x30, 0x00, 0x00, 0x00, 0x60, 0x40, 0x00, 0x00, 0x00, 0x10,
+ 0x70, 0x00, 0x00, 0x00, 0x70, 0x40, 0x00, 0x00, 0x00, 0x10, 0xf0, 0x01,
+ 0x00, 0x00, 0x7c, 0x40, 0x00, 0x00, 0x00, 0x20, 0xf0, 0x0f, 0x00, 0x80,
+ 0x7f, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xff, 0x03, 0xfe, 0x7f, 0x20,
+ 0x00, 0x00, 0x00, 0x20, 0xf0, 0x7f, 0xfe, 0xff, 0x7f, 0x20, 0x00, 0x00,
+ 0x00, 0x20, 0xe0, 0x7f, 0xfe, 0xff, 0x3f, 0x20, 0x00, 0x00, 0x00, 0x40,
+ 0xe0, 0x7f, 0xfe, 0xff, 0x3f, 0x10, 0x00, 0x00, 0x00, 0x40, 0xc0, 0xff,
+ 0xff, 0xff, 0x1f, 0x10, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xff, 0xff, 0xff,
+ 0x1f, 0x08, 0x00, 0x00, 0x00, 0x80, 0x80, 0xff, 0xff, 0xff, 0x0f, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0x07, 0x04, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0xfe, 0xff, 0xff, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0xfc, 0xff, 0xfc, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0xf0,
+ 0xff, 0x7c, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc0, 0xff, 0x1c,
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xff, 0x07, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xc0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x3c, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/bonk/bitmaps/bonklogo b/lib/gs/contribs/bonk/bitmaps/bonklogo
new file mode 100644
index 0000000000..3adc59984a
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/bonklogo
@@ -0,0 +1,320 @@
+#define bonklogo_width 300
+#define bonklogo_height 100
+static char bonklogo_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00,
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+ 0x83, 0xff, 0x9f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x3c, 0xf8, 0xff, 0x7f, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x87, 0xff, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xf9, 0xff, 0xff, 0xff, 0x13, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x27,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff,
+ 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+ 0xff, 0xff, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f,
+ 0xfe, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+ 0xff, 0x2f, 0xf8, 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0xdf, 0xff, 0x2f, 0xf0, 0xff, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xc3, 0xff, 0x2f, 0xf0, 0xff, 0x09, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xff, 0x2f, 0xe0, 0xff, 0x0b, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x80, 0xff, 0x09,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x2f, 0xc0, 0xff,
+ 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xc0,
+ 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x27,
+ 0xc0, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x01,
+ 0x00, 0xc0, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+ 0xff, 0x17, 0xc0, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+ 0x7f, 0x01, 0x00, 0xe0, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0xff, 0x17, 0xc0, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xfc, 0x7f, 0x01, 0x00, 0xe0, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17, 0x80, 0xff, 0x17, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0x7f, 0xff, 0x3f, 0xe0, 0x7f, 0x02, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17, 0x80, 0xff, 0x17, 0xc0,
+ 0xff, 0x7f, 0xe0, 0xff, 0x3f, 0xfc, 0x7f, 0x00, 0x20, 0xe0, 0x7f, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17, 0x80, 0xff,
+ 0x17, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0xfc, 0x7f, 0xfe, 0x2f, 0xf0,
+ 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17,
+ 0x80, 0xff, 0x17, 0xe0, 0xff, 0x1f, 0xe1, 0xff, 0x2f, 0xfc, 0x7f, 0xfe,
+ 0x2f, 0xf0, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xff, 0x17, 0x80, 0xff, 0x17, 0xf0, 0xff, 0x7f, 0xe6, 0xff, 0x4f, 0xfc,
+ 0x7f, 0xfe, 0x2f, 0xf0, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0xff, 0x17, 0x80, 0xff, 0x17, 0xf8, 0xff, 0xff, 0xe8, 0xff,
+ 0x4f, 0xfc, 0x7f, 0xfe, 0x2f, 0xf8, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17, 0x80, 0xff, 0x17, 0xfe, 0xff, 0xff,
+ 0xeb, 0xff, 0x5f, 0xfc, 0x7f, 0xfe, 0x2f, 0xf8, 0x9f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17, 0x80, 0xff, 0x17, 0xfe,
+ 0xff, 0xff, 0xe3, 0xff, 0x5f, 0xfc, 0x7f, 0xfe, 0x2f, 0xf8, 0x5f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17, 0xc0, 0xff,
+ 0x17, 0xff, 0xff, 0xff, 0xe7, 0xff, 0x5f, 0xfc, 0x7f, 0xfe, 0x2f, 0xfc,
+ 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x17,
+ 0xc0, 0xff, 0x93, 0xff, 0xff, 0xff, 0xe7, 0xff, 0x5f, 0xfc, 0x7f, 0xfe,
+ 0x2f, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xff, 0x17, 0xc0, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xe7, 0xff, 0x9f, 0xfc,
+ 0x7f, 0xfe, 0x2f, 0xfc, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0xff, 0x13, 0xe0, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xcf, 0xff,
+ 0xbf, 0xfc, 0x7f, 0xfe, 0x2f, 0xfc, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0b, 0xf2, 0xff, 0xcd, 0xff, 0xff, 0xff,
+ 0xcf, 0xff, 0xbf, 0xfc, 0x7f, 0xfe, 0x2f, 0xfe, 0x17, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0b, 0xf9, 0xff, 0xd9, 0xff,
+ 0xff, 0xff, 0x1f, 0xff, 0xbf, 0xfc, 0x7f, 0xfe, 0x2f, 0xfe, 0x13, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcb, 0xfc, 0xff,
+ 0xc0, 0xff, 0x8f, 0xff, 0x1f, 0xff, 0xbf, 0xfc, 0x7f, 0xfe, 0x2f, 0xfe,
+ 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x2b,
+ 0xfe, 0xff, 0x87, 0xff, 0x03, 0xff, 0x3f, 0xff, 0xbf, 0xfc, 0x7f, 0xfe,
+ 0x2f, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0x9b, 0xff, 0xff, 0x3f, 0xff, 0x01, 0xfe, 0x3f, 0xff, 0x3f, 0xfd,
+ 0x7f, 0xfe, 0x2f, 0xff, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xc3, 0xff, 0xff, 0x7f, 0xfe, 0x05, 0xfc, 0x3f, 0xff,
+ 0x7f, 0xfd, 0x7f, 0xfe, 0x2f, 0xff, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xfc, 0x04, 0xfc,
+ 0x3f, 0xff, 0x7f, 0xfd, 0x7f, 0xfe, 0x2f, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc,
+ 0x02, 0xf8, 0x3f, 0xff, 0x7f, 0xfd, 0x7f, 0xfe, 0xaf, 0xff, 0x04, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xfd, 0x02, 0xf8, 0x3f, 0xff, 0x7f, 0xfc, 0x7f, 0xfe, 0xaf, 0xff,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf9, 0x02, 0xf8, 0x3f, 0xff, 0x7f, 0xfc, 0x7f, 0xfe,
+ 0x8f, 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xfb, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfc,
+ 0x7f, 0xfe, 0xcf, 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x02, 0xf8, 0x3f, 0xff,
+ 0xff, 0xfc, 0x7f, 0xfe, 0xcf, 0x7f, 0x01, 0x00, 0x00, 0x38, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x02, 0xf8,
+ 0x3f, 0xff, 0xff, 0xfc, 0x7f, 0xfe, 0xcf, 0x3f, 0x01, 0x00, 0x00, 0x38,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0xf7,
+ 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfc, 0x7f, 0xfe, 0xef, 0x3f, 0x01, 0x00,
+ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x80, 0xff,
+ 0xff, 0xe7, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfc, 0x7f, 0xfe, 0xef, 0x9f,
+ 0x00, 0x00, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01,
+ 0x00, 0xff, 0xff, 0xe7, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfd, 0x7f, 0xfe,
+ 0xef, 0xdf, 0x00, 0x00, 0x00, 0x30, 0xd8, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+ 0xff, 0x05, 0x00, 0xff, 0xff, 0xe7, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfd,
+ 0x7f, 0xfe, 0xef, 0x9f, 0x00, 0x00, 0x00, 0x38, 0xfc, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0xff, 0x05, 0x00, 0xff, 0xff, 0xef, 0x02, 0xf8, 0x3f, 0xff,
+ 0xff, 0xfd, 0x7f, 0xfe, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x38, 0x7c, 0x0e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf8, 0xff, 0x05, 0x00, 0xfe, 0xff, 0xef, 0x02, 0xf8,
+ 0x3f, 0xff, 0xff, 0xfd, 0x7f, 0xfe, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x38,
+ 0x3e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x05, 0x00, 0xfe, 0xff, 0xef,
+ 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfd, 0x7f, 0xfe, 0xff, 0x7f, 0x02, 0x00,
+ 0x00, 0x38, 0x3e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x05, 0x00, 0xfc,
+ 0xff, 0xcf, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xfd, 0x7f, 0xfe, 0xff, 0xff,
+ 0x02, 0x00, 0x00, 0x38, 0x3b, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x04,
+ 0x00, 0xfc, 0xff, 0xcf, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0xfe,
+ 0xff, 0xff, 0x04, 0x00, 0x00, 0xb8, 0x39, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+ 0xff, 0x02, 0x00, 0xfc, 0xff, 0xcf, 0x02, 0xf8, 0x3f, 0xff, 0xff, 0xff,
+ 0x7f, 0xfe, 0xff, 0xff, 0x05, 0x00, 0x00, 0xf0, 0x39, 0x3c, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0xff, 0x02, 0x00, 0xfc, 0xff, 0xcf, 0x04, 0xf8, 0x3f, 0xff,
+ 0xfd, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x09, 0x00, 0x00, 0xf0, 0x38, 0x1c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf8, 0xff, 0x02, 0x00, 0xfc, 0xff, 0xcf, 0x05, 0xf8,
+ 0x3f, 0xff, 0xfd, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x13, 0x00, 0x00, 0x60,
+ 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x02, 0x00, 0xfc, 0xff, 0xcf,
+ 0x0d, 0xf8, 0x3f, 0xff, 0xfd, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x17, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x02, 0x00, 0xfe,
+ 0xff, 0xcf, 0x09, 0xfd, 0x3f, 0xff, 0xfd, 0xff, 0x7f, 0xfe, 0xff, 0xff,
+ 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x02,
+ 0x00, 0xfe, 0xff, 0xcf, 0xcb, 0xfc, 0x3f, 0xff, 0xfd, 0xff, 0x7f, 0xfe,
+ 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+ 0xff, 0x02, 0x00, 0xfe, 0xff, 0xcf, 0x33, 0xfe, 0x3f, 0xff, 0xf9, 0xff,
+ 0x7f, 0xfe, 0xff, 0xff, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xfc, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xcf, 0x07, 0xff, 0x3f, 0xff,
+ 0xf9, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xff, 0x02, 0x00, 0xfe, 0xff, 0xcf, 0xcf, 0xff,
+ 0x3f, 0xff, 0xf9, 0xff, 0x7f, 0xfe, 0x7f, 0xff, 0x3f, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x02, 0x40, 0xfe, 0xff, 0xcf,
+ 0xff, 0xff, 0x3f, 0xff, 0xf9, 0xff, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x02, 0x3c, 0xff,
+ 0xff, 0xc7, 0xff, 0xff, 0x3f, 0xff, 0xf9, 0xff, 0x7f, 0xfe, 0x7f, 0xfe,
+ 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x82,
+ 0x87, 0xff, 0xff, 0xe7, 0xff, 0xff, 0x3f, 0xff, 0xf1, 0xff, 0x7f, 0xfe,
+ 0x3f, 0xfc, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+ 0xff, 0x72, 0xf0, 0xff, 0xff, 0xe7, 0xff, 0xff, 0x3f, 0xff, 0xf1, 0xff,
+ 0x7f, 0xfe, 0xbf, 0xf8, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xfc, 0xff, 0x0e, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0x9f, 0xff,
+ 0xf5, 0xff, 0x7f, 0xfe, 0xbf, 0xf8, 0xff, 0x09, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff,
+ 0x9f, 0xff, 0xf5, 0xff, 0x7f, 0xfe, 0x9f, 0xf0, 0xff, 0x0b, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7,
+ 0xff, 0xff, 0x9f, 0xff, 0xf5, 0xff, 0x7f, 0xfe, 0x5f, 0xf0, 0xff, 0x13,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xf3, 0xff, 0xff, 0xdf, 0xff, 0xf5, 0xff, 0x7f, 0xfe, 0x4f, 0xe0,
+ 0xff, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xfe, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xcf, 0xff, 0xe5, 0xff, 0x7f, 0xfe,
+ 0x2f, 0xe0, 0xff, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xcf, 0xff, 0xe5, 0xff,
+ 0x7f, 0xfe, 0x2f, 0xc0, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xe7, 0xff,
+ 0xe5, 0xff, 0x7f, 0xfe, 0x2f, 0xc0, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff,
+ 0xe7, 0xff, 0xe5, 0xff, 0x7f, 0xfe, 0x2f, 0x80, 0xff, 0x9f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc,
+ 0xff, 0xff, 0xf7, 0xff, 0xe5, 0xff, 0x7f, 0xfe, 0x2f, 0x00, 0xff, 0x3f,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x1f, 0xfe, 0xff, 0xff, 0xf3, 0xff, 0xc5, 0xff, 0x7f, 0xfe, 0x2f, 0x00,
+ 0xff, 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xc5, 0xff, 0x7f, 0xfe,
+ 0x2f, 0x00, 0xfe, 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x23, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xc5, 0xff,
+ 0x7f, 0xfe, 0x2f, 0x00, 0xfe, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x11, 0xfe, 0xff, 0xff, 0xf5, 0xff,
+ 0xc5, 0xff, 0x7f, 0xfe, 0x2f, 0x00, 0xfc, 0xff, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x0c, 0xfc, 0xff, 0xff,
+ 0xf4, 0xff, 0xc5, 0xff, 0x7f, 0xfe, 0x2f, 0x00, 0xfc, 0xff, 0x09, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x02, 0xfc,
+ 0xff, 0x7f, 0xf2, 0xff, 0xc5, 0xff, 0x7f, 0xfe, 0x2f, 0x00, 0xf8, 0xff,
+ 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0xe0, 0xff, 0x3f, 0xf1, 0xff, 0x85, 0xff, 0x7f, 0xfe, 0x2f, 0x00,
+ 0xf8, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
+ 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x85, 0xff, 0x7f, 0xfe,
+ 0x2f, 0x00, 0xf0, 0xff, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
+ 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x85, 0xff,
+ 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/bonk/bitmaps/bonkmiss b/lib/gs/contribs/bonk/bitmaps/bonkmiss
new file mode 100644
index 0000000000..862e4839fc
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/bonkmiss
@@ -0,0 +1,66 @@
+#define bonkmiss_width 75
+#define bonkmiss_height 75
+static char bonkmiss_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x60, 0x80, 0x19, 0x3c, 0xc0, 0x83, 0xff, 0xf9, 0x01, 0x00, 0x60, 0x80,
+ 0x19, 0x7e, 0xe0, 0x87, 0xff, 0xf9, 0x03, 0x00, 0xe0, 0xc0, 0x19, 0xe7,
+ 0x70, 0x8e, 0x01, 0x18, 0x07, 0x00, 0xe0, 0xc0, 0x99, 0xc3, 0x39, 0x9c,
+ 0x01, 0x18, 0x0e, 0x00, 0xe0, 0xe1, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18,
+ 0x0c, 0x00, 0xe0, 0xe1, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18, 0x1c, 0x00,
+ 0xe0, 0xf3, 0x99, 0x01, 0x18, 0x80, 0x01, 0x18, 0x18, 0x00, 0x60, 0xb3,
+ 0x99, 0x01, 0x18, 0x80, 0x01, 0x18, 0x18, 0x00, 0x60, 0xb3, 0x99, 0x03,
+ 0x38, 0x80, 0x01, 0x18, 0x18, 0x00, 0x60, 0x9e, 0x19, 0x07, 0x70, 0x80,
+ 0x01, 0x18, 0x18, 0x00, 0x60, 0x9e, 0x19, 0x3e, 0xe0, 0x83, 0x1f, 0x18,
+ 0x18, 0x00, 0x60, 0x8c, 0x19, 0x7c, 0xc0, 0x87, 0x1f, 0x18, 0x18, 0x00,
+ 0x60, 0x80, 0x19, 0xe0, 0x00, 0x8e, 0x01, 0x18, 0x18, 0x00, 0x60, 0x80,
+ 0x19, 0xc0, 0x01, 0x9c, 0x01, 0x18, 0x18, 0x00, 0x60, 0x80, 0x19, 0x80,
+ 0x01, 0x98, 0x01, 0x18, 0x18, 0x00, 0x60, 0x80, 0x19, 0x80, 0x01, 0x98,
+ 0x01, 0x18, 0x18, 0x00, 0x60, 0x80, 0x19, 0x80, 0x01, 0x98, 0x01, 0x18,
+ 0x18, 0x00, 0x60, 0x80, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18, 0x18, 0x00,
+ 0x60, 0x80, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18, 0x18, 0x00, 0x60, 0x80,
+ 0x99, 0x81, 0x19, 0x98, 0x01, 0x18, 0x18, 0x00, 0x60, 0x80, 0x99, 0x81,
+ 0x19, 0x98, 0x01, 0x18, 0x18, 0x00, 0x60, 0x80, 0x99, 0x81, 0x19, 0x98,
+ 0x01, 0x18, 0x18, 0x00, 0x60, 0x80, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18,
+ 0x18, 0x00, 0x60, 0x80, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18, 0x1c, 0x00,
+ 0x60, 0x80, 0x99, 0x81, 0x19, 0x98, 0x01, 0x18, 0x0c, 0x00, 0x60, 0x80,
+ 0x99, 0xc3, 0x39, 0x9c, 0x01, 0x18, 0x0e, 0x00, 0x60, 0x80, 0x19, 0xe7,
+ 0x70, 0x8e, 0x01, 0x18, 0x07, 0x00, 0x60, 0x80, 0x19, 0x7e, 0xe0, 0x87,
+ 0xff, 0xf9, 0x03, 0x00, 0x60, 0x80, 0x19, 0x3c, 0xc0, 0x83, 0xff, 0xf9,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0xff, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1c, 0x38, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1c, 0x38, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
+ 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x3e, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x36, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x6c, 0x36, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xcc, 0x33, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc,
+ 0x33, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x31, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0c, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0c, 0x30, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x30, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/bonk/bitmaps/bonktom b/lib/gs/contribs/bonk/bitmaps/bonktom
new file mode 100644
index 0000000000..defbc32cc9
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/bonktom
@@ -0,0 +1,66 @@
+#define bonktom_width 75
+#define bonktom_height 75
+static char bonktom_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/bonk/bitmaps/bonkx b/lib/gs/contribs/bonk/bitmaps/bonkx
new file mode 100644
index 0000000000..70cd89bdb7
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/bonkx
@@ -0,0 +1,66 @@
+#define bonkx_width 75
+#define bonkx_height 75
+static char bonkx_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x3e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf8, 0x03, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01,
+ 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0xf0, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0xe0, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0xfe, 0x03,
+ 0x00, 0xc0, 0x1f, 0x00, 0x80, 0x3f, 0x00, 0xe0, 0x01, 0x3c, 0x00, 0xe0,
+ 0x0f, 0x00, 0x00, 0x7f, 0x00, 0x18, 0x00, 0xc0, 0x00, 0xf0, 0x07, 0x00,
+ 0x00, 0xfe, 0x00, 0x06, 0x00, 0x00, 0x03, 0xf8, 0x03, 0x00, 0x00, 0xfc,
+ 0x81, 0x01, 0x00, 0x00, 0x0c, 0xfc, 0x01, 0x00, 0x00, 0xf8, 0x43, 0x00,
+ 0x00, 0x00, 0x10, 0xfe, 0x00, 0x00, 0x00, 0xf0, 0x27, 0x00, 0x00, 0x00,
+ 0x20, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x3f,
+ 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00,
+ 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00,
+ 0x7f, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0x08,
+ 0x00, 0x80, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x31, 0x00, 0x60,
+ 0xfc, 0x05, 0x00, 0x00, 0x00, 0x80, 0xf8, 0xc3, 0x00, 0x18, 0xfe, 0x08,
+ 0x00, 0x00, 0x00, 0x80, 0xf7, 0x07, 0x03, 0x06, 0x7f, 0x0f, 0x00, 0x00,
+ 0x00, 0x40, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x17, 0x00, 0x00, 0x00, 0x40,
+ 0xfe, 0x1f, 0x00, 0xc0, 0xff, 0x13, 0x00, 0x00, 0x00, 0x20, 0xf8, 0xff,
+ 0x03, 0xfe, 0xff, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xff, 0xff, 0xff,
+ 0x7f, 0x20, 0x00, 0x00, 0x00, 0x20, 0xc0, 0xff, 0xdf, 0xff, 0x1f, 0x20,
+ 0x00, 0x00, 0x00, 0x20, 0x00, 0xff, 0xdf, 0xff, 0x07, 0x20, 0x00, 0x00,
+ 0x00, 0x10, 0x00, 0xfe, 0x8f, 0xff, 0x03, 0x40, 0x00, 0x00, 0x00, 0x10,
+ 0x00, 0xf8, 0x8f, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0xf0,
+ 0x8f, 0x7f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0xc0, 0xdf, 0x1f,
+ 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x40,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xff, 0x07, 0x00, 0x40, 0x00, 0x00,
+ 0x00, 0x10, 0x00, 0x00, 0xfe, 0x03, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10,
+ 0x00, 0x00, 0xfc, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x00, 0xe0,
+ 0xfe, 0x3b, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10, 0x10, 0xf0, 0xff, 0x7f,
+ 0x40, 0x40, 0x00, 0x00, 0x00, 0x10, 0x10, 0x80, 0xff, 0x0f, 0x40, 0x40,
+ 0x00, 0x00, 0x00, 0x10, 0x10, 0xc0, 0xff, 0x1f, 0x40, 0x40, 0x00, 0x00,
+ 0x00, 0x10, 0x30, 0xe0, 0x8f, 0x3f, 0x60, 0x40, 0x00, 0x00, 0x00, 0x10,
+ 0x70, 0xf0, 0x07, 0x7f, 0x70, 0x40, 0x00, 0x00, 0x00, 0x10, 0xf0, 0xf9,
+ 0x03, 0xfe, 0x7c, 0x40, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xff, 0x01, 0xfc,
+ 0x7f, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xff, 0x03, 0xfe, 0x7f, 0x20,
+ 0x00, 0x00, 0x00, 0x20, 0xf0, 0x7f, 0xfe, 0xff, 0x7f, 0x20, 0x00, 0x00,
+ 0x00, 0x20, 0xe0, 0x7f, 0xfe, 0xff, 0x3f, 0x20, 0x00, 0x00, 0x00, 0x40,
+ 0xe0, 0x7f, 0xfe, 0xff, 0x3f, 0x10, 0x00, 0x00, 0x00, 0x40, 0xe0, 0xff,
+ 0xff, 0xff, 0x3f, 0x10, 0x00, 0x00, 0x00, 0x80, 0xf0, 0xff, 0xff, 0xff,
+ 0x7f, 0x08, 0x00, 0x00, 0x00, 0x80, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xfe, 0xff, 0xff, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x7f, 0xfc, 0xff, 0xfc, 0xf1, 0x07, 0x00, 0x00, 0x00, 0x80, 0x3f, 0xf0,
+ 0xff, 0x7c, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0xc0, 0xff, 0x1c,
+ 0xc0, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xff, 0x07, 0xc0, 0x3f,
+ 0x00, 0x00, 0x00, 0xf0, 0x27, 0x00, 0x00, 0x00, 0x20, 0x7f, 0x00, 0x00,
+ 0x00, 0xf8, 0x43, 0x00, 0x00, 0x00, 0x10, 0xfe, 0x00, 0x00, 0x00, 0xfc,
+ 0x81, 0x01, 0x00, 0x00, 0x0c, 0xfc, 0x01, 0x00, 0x00, 0xfe, 0x00, 0x06,
+ 0x00, 0x00, 0x03, 0xf8, 0x03, 0x00, 0x00, 0x7f, 0x00, 0x18, 0x00, 0xc0,
+ 0x00, 0xf0, 0x07, 0x00, 0x80, 0x3f, 0x00, 0xe0, 0x01, 0x3c, 0x00, 0xe0,
+ 0x0f, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0xfe, 0x03, 0x00, 0xc0, 0x1f, 0x00,
+ 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xf0, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0xf8, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfc, 0x01, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf8, 0x03, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03,
+ 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/bonk/bitmaps/erl-e b/lib/gs/contribs/bonk/bitmaps/erl-e
new file mode 100644
index 0000000000..41ad14f404
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/erl-e
@@ -0,0 +1,106 @@
+#define erl-e_width 108
+#define erl-e_height 88
+static char erl-e_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xf7, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xf7, 0xfc, 0x7f, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf7, 0xfc, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf7,
+ 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
+ 0xff, 0xf7, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0xf7, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0xfe, 0xf7, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0xe0,
+ 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfc, 0xf7, 0xfc, 0x0f, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc, 0xf7, 0xfc, 0x07,
+ 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xf7,
+ 0xfc, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
+ 0xf8, 0xf7, 0xfc, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00,
+ 0x00, 0x00, 0xf8, 0xf7, 0xfc, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xfc, 0x01, 0x00, 0x00, 0x00, 0xfc,
+ 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xfc, 0x01, 0x00, 0x00,
+ 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xfc, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xf7,
+ 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xf7, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xf7, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x7c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x7c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7,
+ 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe0, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x3c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x3c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf7,
+ 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe0, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf7, 0x3c, 0x00, 0x00, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7,
+ 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00,
+ 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7,
+ 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x7c, 0x00, 0x00, 0x00,
+ 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x7c, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7,
+ 0x7c, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xf7, 0x7c, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
+ 0x7f, 0xfe, 0xff, 0xf7, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
+ 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xf7, 0xfc, 0x00, 0x00, 0x00, 0x00, 0xf8,
+ 0xff, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0xf7, 0xfc, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xc0, 0xff, 0xf7, 0xfc, 0x01,
+ 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xfe, 0xf7,
+ 0xfc, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0xf8, 0xf7, 0xfc, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0xe0, 0xf7, 0xfc, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
+ 0xff, 0xff, 0x03, 0x00, 0xc0, 0xf7, 0xfc, 0x03, 0x00, 0x00, 0x00, 0xc0,
+ 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x80, 0xf7, 0xfc, 0x07, 0x00, 0x00,
+ 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x80, 0xf7, 0xfc, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x80, 0xf7,
+ 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x1f, 0x00, 0x00,
+ 0xc0, 0xf7, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x0f,
+ 0x00, 0x00, 0xe0, 0xf7, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+ 0xff, 0x07, 0x00, 0x00, 0xe0, 0xf7, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xf7, 0xfc, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0xfc, 0x7f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0xf7,
+ 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0xf7, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0xf7, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xf7, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf7, 0xfc, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xf7, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0};
diff --git a/lib/gs/contribs/bonk/bitmaps/erl-text b/lib/gs/contribs/bonk/bitmaps/erl-text
new file mode 100644
index 0000000000..e20a9e5a28
--- /dev/null
+++ b/lib/gs/contribs/bonk/bitmaps/erl-text
@@ -0,0 +1,106 @@
+#define erl-text_width 108
+#define erl-text_height 88
+static char erl-text_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+ 0xfc, 0x03, 0xf8, 0x00, 0x70, 0x00, 0x80, 0x03, 0x80, 0x03, 0x07, 0x00,
+ 0x3e, 0xf0, 0xfc, 0x03, 0xf8, 0x03, 0x70, 0x00, 0x80, 0x03, 0x80, 0x07,
+ 0x07, 0x80, 0xff, 0xf0, 0xfc, 0x03, 0xf8, 0x07, 0x70, 0x00, 0xc0, 0x07,
+ 0x80, 0x07, 0x07, 0xe0, 0xff, 0xf1, 0x1c, 0x00, 0x38, 0x07, 0x70, 0x00,
+ 0xc0, 0x07, 0x80, 0x0f, 0x07, 0xe0, 0xc1, 0xf3, 0x1c, 0x00, 0x38, 0x0e,
+ 0x70, 0x00, 0xe0, 0x0f, 0x80, 0x1f, 0x07, 0xf0, 0x80, 0xf3, 0x1c, 0x00,
+ 0x38, 0x0f, 0x70, 0x00, 0xe0, 0x0e, 0x80, 0x1f, 0x07, 0x78, 0x00, 0xf0,
+ 0xfc, 0x03, 0xf8, 0x07, 0x70, 0x00, 0xe0, 0x0e, 0x80, 0x3f, 0x07, 0x78,
+ 0x00, 0xf0, 0xfc, 0x03, 0xf8, 0x03, 0x70, 0x00, 0x70, 0x1c, 0x80, 0x7b,
+ 0x07, 0x38, 0x00, 0xf0, 0xfc, 0x03, 0xf8, 0x01, 0x70, 0x00, 0x70, 0x1c,
+ 0x80, 0xf3, 0x07, 0x38, 0xf8, 0xf7, 0x1c, 0x00, 0xf8, 0x01, 0x70, 0x00,
+ 0x70, 0x1c, 0x80, 0xe3, 0x07, 0x78, 0xf8, 0xf7, 0x1c, 0x00, 0xf8, 0x03,
+ 0x70, 0x00, 0xf8, 0x3f, 0x80, 0xe3, 0x07, 0x70, 0x80, 0xf7, 0x1c, 0x00,
+ 0xb8, 0x03, 0x70, 0x00, 0xf8, 0x3f, 0x80, 0xc3, 0x07, 0xf0, 0x80, 0xf3,
+ 0xfc, 0x03, 0x38, 0x07, 0xf0, 0x07, 0x38, 0x38, 0x80, 0x83, 0x07, 0xe0,
+ 0xe3, 0xf3, 0xfc, 0x03, 0x38, 0x07, 0xf0, 0x07, 0x1c, 0x70, 0x80, 0x83,
+ 0x07, 0xc0, 0xff, 0xf1, 0xfc, 0x03, 0x38, 0x0e, 0xf0, 0x07, 0x1c, 0x70,
+ 0x80, 0x03, 0x07, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0};
diff --git a/lib/gs/contribs/bonk/bonk.erl b/lib/gs/contribs/bonk/bonk.erl
new file mode 100644
index 0000000000..12d94f6c5e
--- /dev/null
+++ b/lib/gs/contribs/bonk/bonk.erl
@@ -0,0 +1,579 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(bonk).
+-export([run/0, run/1,bonk_dir/0,start/0]).
+
+-record(colors, {miss, x, bomb, face}).
+-record(scores, {points, level, bombs, hits, showed, bonus}).
+
+start() ->
+ spawn(bonk, run, []).
+
+run() ->
+ run(color).
+
+run([ColorMode]) -> % This is for the start script...
+ run(ColorMode);
+
+run(ColorMode) when atom(ColorMode) ->
+ GS = gs:start(),
+ SoundPid=spawn_link(bonk_sound,start,[]),
+ {H,M,S}=time(),
+ random:seed(H*13,M*7,S*3),
+ {SqrPids, Bmps, Colors} = create_board(GS, ColorMode),
+ {ScoreL,_File} = get_highscore(),
+ display_highscore(ScoreL),
+ put(colormode, ColorMode),
+ SoundPid ! music,
+ sleep(6500),
+ gs:config(aboutButton, [{enable,true}]),
+ gs:config(newButton, [{enable,true}]),
+ gs:config(quitButton, [{enable,true}]),
+ idle(SoundPid, SqrPids, Bmps, Colors).
+
+%% This is not an application so we don't have their way of knowing
+%% a private data directory where the GIF files are located (this directory).
+%% We can find GS and makes it relative from there /kgb
+%%
+%% Note the silly slash that is added. The rest of the code uses
+%% append to contruct file names and assumes that the directory ends
+%% in slash. If filename:join was used and the problem is gone.
+
+-define(EbinFromGsPriv,"../contribs/bonk").
+
+bonk_dir() ->
+ GsPrivDir = code:priv_dir(gs),
+ filename:join(GsPrivDir,?EbinFromGsPriv) ++ "/".
+
+
+idle(SoundPid, SqrPids, Bmps, Colors) ->
+ receive
+ {gs, newButton, click, _Data, _Args} ->
+ init(SoundPid, SqrPids, Bmps, Colors);
+ {gs, aboutButton, click, _Data, _Args} ->
+ display_about(),
+ idle(SoundPid, SqrPids, Bmps, Colors);
+ {gs, quitButton, click, _Data, _Args} ->
+ SoundPid ! quit,
+ send_to_all(SqrPids, quit);
+ _Other ->
+ %%io:format("Got ~w in idle~n", [_Other]),
+ idle(SoundPid, SqrPids, Bmps, Colors)
+ end.
+
+
+
+init(SoundPid, SqrPids, Bmps, Colors) ->
+ clear_board(Bmps),
+ SoundPid ! start,
+ gs:config(newButton, [{enable,false}]),
+ gs:config(endButton, [{enable,true}]),
+ gs:config(aboutButton, [{enable,false}]),
+ Scores = #scores{points=0, level=1, bombs=0, hits=0, showed=0, bonus=10},
+ clear_scores(Scores),
+ flush(),
+ send_to_all(SqrPids, start),
+ game(SoundPid, SqrPids, Bmps, Colors, Scores).
+
+
+game(SoundPid, SqrPids, Bmps, Colors, Scores) ->
+ receive
+ {gs, _Square, buttonpress, SqrPid, [1 | _Rest]} when pid(SqrPid) ->
+ SqrPid ! bonk,
+ game(SoundPid, SqrPids, Bmps, Colors, Scores);
+ {gs, _Id, buttonpress, _Data, [Butt | _Rest]} when Butt =/= 1 ->
+ NewScores = bomb(SoundPid, SqrPids, Scores),
+ game(SoundPid, SqrPids, Bmps, Colors, NewScores);
+ {show, Square, Rect} ->
+ NewScores = show_face(Square, Rect, Colors, Scores),
+ game(SoundPid, SqrPids, Bmps, Colors, NewScores);
+ {hide, Square, Rect} ->
+ NewScores = hide_face(Square, Rect, Colors, Scores),
+ game(SoundPid, SqrPids, Bmps, Colors, NewScores);
+ {missed, Square, Rect} ->
+ case miss_face(SoundPid, Square, Rect, Colors, Scores) of
+ {continue, NewScores} ->
+ game(SoundPid, SqrPids, Bmps, Colors, NewScores);
+ {game_over, NewScores} ->
+ game_over(SoundPid, SqrPids, Bmps, Colors, NewScores)
+ end;
+ {bonked, Square, Rect} ->
+ NewScores = bonked(SoundPid, SqrPids, Square, Rect, Scores, Colors),
+ game(SoundPid, SqrPids, Bmps, Colors, NewScores);
+ {bombed, Square, Rect} ->
+ NewScores = bombed(SoundPid, SqrPids, Square, Rect, Scores, Colors),
+ game(SoundPid, SqrPids, Bmps, Colors, NewScores);
+ {gs, endButton, click, _Data, _Args} ->
+ game_over(SoundPid, SqrPids, Bmps, Colors, Scores);
+ {gs, quitButton, click, _Data, _Args} ->
+ quit(SoundPid, SqrPids, Bmps, Colors, Scores);
+ _Other ->
+ game(SoundPid, SqrPids, Bmps, Colors, Scores)
+ end.
+
+
+
+game_over(SoundPid, SqrPids, Bmps, Colors, Scores) ->
+ SoundPid ! game_over,
+ send_to_all(SqrPids, stop),
+ flush(),
+ sleep(2000),
+ update_scorelist(SoundPid, Scores),
+ gs:config(newButton, [{enable,true}]),
+ gs:config(endButton, [{enable,false}]),
+ gs:config(aboutButton, [{enable,true}]),
+ idle(SoundPid, SqrPids, Bmps, Colors).
+
+
+quit(SoundPid, SqrPids, _Bmps, _Colors, _Scores) ->
+ SoundPid ! quit,
+ send_to_all(SqrPids, quit),
+ true.
+
+
+
+bomb(SoundPid, SqrPids, Scores) ->
+ case Scores#scores.bombs of
+ Bombs when Bombs > 0 ->
+ send_to_all(SqrPids, bomb),
+ SoundPid ! bomb,
+ gs:config(bombOut,[{text,integer_to_list(Bombs-1)}]),
+ Scores#scores{bombs=Bombs-1};
+ _Other ->
+ Scores
+ end.
+
+show_face(Square, Rect, Colors, Scores) ->
+ Showed = Scores#scores.showed,
+ if
+ Showed == Scores#scores.level+1 ->
+ Square ! sleep,
+ Scores;
+ true ->
+ FaceColors = Colors#colors.face,
+ FaceColor = lists:nth(random:uniform(length(FaceColors)), FaceColors),
+ gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkface")},{fg, FaceColor}]),
+ Scores#scores{showed=Showed+1}
+ end.
+
+hide_face(_Square, Rect, _Colors, Scores) ->
+ Showed = Scores#scores.showed,
+ gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonktom")}]),
+ Scores#scores{showed=Showed-1}.
+
+
+miss_face(SoundPid, _Square, Rect, Colors, Scores) ->
+ SoundPid ! missed,
+ gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkmiss")}, {fg, Colors#colors.miss}]),
+ Bonus = Scores#scores.bonus,
+ if
+ Bonus > 1 ->
+ gs:config(bonusOut, [{text,integer_to_list(Bonus-1)}]),
+ {continue, Scores#scores{bonus=Bonus-1}};
+ true ->
+ gs:config(bonusOut, [{text,"0"}]),
+ {game_over, Scores}
+ end.
+
+bonked(SoundPid, SqrPids, _Square, Rect, Scores, Colors) ->
+ gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkx")}, {fg, Colors#colors.x}]),
+ SoundPid ! bonk,
+ update_score(SoundPid, SqrPids, Scores).
+
+bombed(SoundPid, SqrPids, _Square, Rect, Scores, Colors) ->
+ gs:config(Rect, [{bitmap,lists:append(bonk_dir(),"bitmaps/bonkbomb")}, {fg, Colors#colors.bomb}]),
+ update_score(SoundPid, SqrPids, Scores).
+
+
+update_score(SoundPid, SqrPids, Scores) ->
+ Points = Scores#scores.points,
+ Level = Scores#scores.level,
+ NewPoints = Points+Level,
+ gs:config(scoreOut,[{text,integer_to_list(NewPoints)}]),
+ case Scores#scores.hits of
+ 24 ->
+ SoundPid ! new_level,
+ NewLevel = Level+1,
+ NewBombs = Scores#scores.bombs+1,
+ send_to_all(SqrPids, {new_level, NewLevel}),
+ gs:config(levelOut,[{text,integer_to_list(NewLevel)}]),
+ gs:config(bombOut,[{text,integer_to_list(NewBombs)}]),
+ Scores#scores{points=NewPoints, level=NewLevel, hits=0, bombs=NewBombs};
+ Hits ->
+ Scores#scores{points=NewPoints, hits=Hits+1}
+ end.
+
+
+send_to_all([], _Msg) ->
+ true;
+
+send_to_all([Pid|Rest],Msg) when pid(Pid) ->
+ Pid ! Msg,
+ send_to_all(Rest,Msg);
+
+send_to_all([_Else|Rest],Msg) ->
+ send_to_all(Rest,Msg).
+
+
+create_board(GS, ColorMode) ->
+ Colors =
+ case ColorMode of
+ bw -> #colors{miss=white, x=white, bomb=white, face=[white]};
+ _Color -> #colors{miss=red, x=green, bomb=white,
+ face=[lightblue, orange, magenta, peachpuff, pink]}
+ end,
+ BGCol = if ColorMode==bw -> black; true -> black end, % background color
+ TextCol = if ColorMode==bw -> white; true -> pink end, % status texts
+ NrCol = if ColorMode==bw -> white; true -> purple end, % status figures
+ LogoCol = if ColorMode==bw -> white; true -> green end, % bonk logo
+ BLineCol = if ColorMode==bw -> white; true -> grey end, % button line
+ SLineCol = if ColorMode==bw -> white; true -> red end, % status line
+ BTextCol = if ColorMode==bw -> white; true -> orange end, % button text
+ HiHeadCol = if ColorMode==bw -> white; true -> red end, % high score label
+ HiCol = if ColorMode==bw -> white; true -> cyan end, % high scores
+ SquareCol = if ColorMode==bw -> white; true -> yellow end, % game squares
+ ErlFgCol = if ColorMode==bw -> white; true -> red end, %
+ ErlBGCol = if ColorMode==bw -> black; true -> white end, %
+ ErlTxtCol = if ColorMode==bw -> white; true -> black end, %
+
+ Width = 550, % width of bonk window
+ Height = 550, % Height of bonk window
+
+ BX = 0, % x-pos for first button
+ DBX = 100, % space between buttons
+ BY = 0, % y-pos for buttons
+ BLineY = 30, % y-pos of button line
+ LogoX = (Width-320) div 2, % x-pos of bonk logo (logo is 320 pix wide)
+ LogoY = BLineY+2, % y-pos of bonk logo
+ ErlLogoX = LogoX + 200, % x-pos of Erlang e
+ ErlLogoY = LogoY + 10, % y-pos of Erlang e
+ SLineY = Height-22, % status line position
+ TextWidth = 50, % text width of status items
+ SX = 2, % x-pos for first status item
+ DSX = TextWidth+94, % pixels between status items
+ SY = SLineY+2, % y-pos status items
+ HiWidth = 100, % width of high score field
+ _HiHeight = 180, % height of the same
+ HiX = Width-HiWidth, % high score text position
+ HiY = BLineY+10,
+ DHY = 20, % space between title & scores
+ SquareSize = 76, % size of each game square
+ SquareSpace = 1, % space between game squares
+ SquareX = 40,
+ SquareY = 65,
+
+ gs:create(window, bonkWin, GS, [{width, Width}, {height, Height},
+ {bg, BGCol},
+ {title, "Bonk the game"},
+ {iconname, "Bonk!"},
+ {map, false}]),
+ gs:create(canvas, bonkCanvas, bonkWin, [{width, Width},
+ {height, Height},
+ {bg, BGCol}]),
+ gs:create(image, bonkCanvas, [{bitmap,lists:append(bonk_dir(), "bitmaps/bonklogo")},
+ {coords, [{LogoX, LogoY}]},
+ {fg, LogoCol},
+ {bg, BGCol}]),
+ gs:create(image, bonkCanvas, [{bitmap,lists:append(bonk_dir(), "bitmaps/erl-e")},
+ {coords, [{ErlLogoX, ErlLogoY}]},
+ {fg, ErlFgCol},
+ {bg, ErlBGCol}]),
+ gs:create(image, bonkCanvas, [{bitmap,lists:append(bonk_dir(), "bitmaps/erl-text")},
+ {coords, [{ErlLogoX, ErlLogoY}]},
+ {fg, ErlTxtCol}]),
+ gs:create(line, bLine, bonkCanvas, [{coords, [{0,BLineY}, {Width,BLineY}]},
+ {fg, BLineCol},
+ {width, 2}]),
+ gs:create(line, bLine, bonkCanvas, [{coords, [{0,SLineY}, {Width, SLineY}]},
+ {fg, SLineCol},
+ {width, 2}]),
+ gs:create(text, scoreText, bonkCanvas, [{coords, [{SX, SY}]},
+ {fg, TextCol},
+ {text, "Score:"}]),
+ gs:create(text, scoreOut, bonkCanvas, [{coords, [{SX+TextWidth, SY}]},
+ {fg, NrCol},
+ {width, DSX-TextWidth},
+ {text, ""}]),
+ gs:create(text, bombText, bonkCanvas, [{coords, [{SX+DSX, SY}]},
+ {fg, TextCol},
+ {text, "Bombs:"}]),
+ gs:create(text, bombOut, bonkCanvas, [{coords, [{SX+DSX+TextWidth, SY}]},
+ {fg, NrCol},
+ {width, DSX-TextWidth},
+ {text, ""}]),
+ gs:create(text, bonusText, bonkCanvas, [{coords, [{SX+2*DSX, SY}]},
+ {fg, TextCol},
+ {text, "Bonus:"}]),
+ gs:create(text, bonusOut, bonkCanvas, [{coords, [{SX+2*DSX+TextWidth, SY}]},
+ {fg, NrCol},
+ {width, DSX-TextWidth},
+ {text, ""}]),
+ gs:create(text, levelText,bonkCanvas, [{coords, [{SX+3*DSX, SY}]},
+ {fg, TextCol},
+ {text, "Level:"}]),
+ gs:create(text, levelOut, bonkCanvas, [{coords, [{SX+3*DSX+TextWidth, SY}]},
+ {fg, NrCol},
+ {width, DSX-TextWidth},
+ {text, ""}]),
+ gs:create(text, hiScoreText, bonkCanvas, [{coords, [{HiX, HiY}]},
+ {fg, HiHeadCol},
+ {text, "High Scores"}]),
+ gs:create(text, hiScoreOut, bonkCanvas, [{coords, [{HiX, HiY+DHY}]},
+ {fg, HiCol},
+ {justify, left},
+ {width, HiWidth}]),
+ gs:create(button, newButton,bonkWin, [{x, BX},{y, BY},
+ {enable,false},
+ {label, {text, "New Game"}},
+ {click, true},
+ {fg, BTextCol},
+ {bg, BGCol},
+ {relief, flat},
+ {activefg, BTextCol},
+ {activebg, BGCol},
+ {align, center}]),
+ gs:create(button, endButton,bonkWin, [{x, BX+DBX},{y, BY},
+ {enable,false},
+ {label, {text, "End Game"}},
+ {click, true},
+ {fg, BTextCol},
+ {bg, BGCol},
+ {relief, flat},
+ {activefg, BTextCol},
+ {activebg, BGCol},
+ {align, center}]),
+ gs:create(button, aboutButton,bonkWin, [{x, BX+2*DBX},{y, BY},
+ {enable,false},
+ {label, {text, "About"}},
+ {click, true},
+ {fg, BTextCol},
+ {bg, BGCol},
+ {relief, flat},
+ {activefg, BTextCol},
+ {activebg, BGCol},
+ {align, center}]),
+ gs:create(button, quitButton, bonkWin, [{x, BX+3*DBX},{y, BY},
+ {enable,false},
+ {label, {text, "Quit"}},
+ {click, true},
+ {fg, BTextCol},
+ {bg, BGCol},
+ {relief, flat},
+ {activefg, BTextCol},
+ {activebg, BGCol},
+ {align, center}]),
+
+ {SqrPids, Bmps} =
+ create_squares(SquareX, SquareY, SquareSize, SquareCol, SquareSpace),
+ gs:config(bonkWin, [{map, true}]),
+ {SqrPids, Bmps, Colors}.
+
+
+
+create_squares(X, Y, Size, Color, Spc) ->
+ create_squares(X, Y, Size, Color, Spc, 1, 1, [], []).
+
+
+create_squares(_X, _Y, _Size, _Color, _Spc, 4, 5, Pids, Bmps) ->
+ {Pids, Bmps};
+
+create_squares(X, Y, Size, Color, Spc, Row, 5, Pids, Bmps) ->
+ create_squares(X, Y, Size, Color, Spc, Row+1, 1, Pids, Bmps);
+
+create_squares(X, Y, Size, Color, Spc, Row, Col, Pids, Bmps) ->
+ Xpos = X+Col*Size+(Col-1)*Spc,
+ Ypos = Y+Row*Size+(Row-1)*Spc,
+ gs:create(rectangle, bonkCanvas,
+ [{coords, [{Xpos,Ypos},{Xpos+Size, Ypos+Size}]},
+ {bw, 2},{fg, Color},{buttonpress,true}]),
+ Bmp = gs:create(image, bonkCanvas,
+ [{coords, [{Xpos+1, Ypos+1}]},
+ {bitmap,lists:append(bonk_dir(), "bitmaps/bonktom")},
+ {buttonpress, true},{fg, Color}]),
+ Pid = bonk_square:start(Bmp),
+ gs:config(Bmp, [{data, Pid}]),
+ create_squares(X, Y, Size, Color, Spc, Row, Col+1, [Pid|Pids], [Bmp|Bmps]).
+
+
+
+clear_board([]) ->
+ true;
+clear_board([Square | Rest]) ->
+ gs:config(Square, [{bitmap,lists:append(bonk_dir(), "bitmaps/bonktom")}]),
+ clear_board(Rest).
+
+
+%% Prints the list on the screen.
+%% The list is on the form [[Score,Name],[Score,Name]..].
+
+display_highscore(ScoreList) ->
+ display_highscore("",ScoreList,0).
+
+display_highscore(Scores,[],_N) ->
+ gs:config(hiScoreOut,[{text,Scores}]);
+
+display_highscore(Scores,_ScoreList,10) -> % This is max number of items.
+ display_highscore(Scores,[], 10);
+
+display_highscore(Scores,[[Score,Name]|Rest],N) ->
+ NewScores = lists:append(Scores,lists:append(lists:append(Score, [32 | Name]), [10])),
+ display_highscore(NewScores,Rest,N+1).
+
+
+%% Reads the highscorelist from the file "bonk.score".
+%% The list should be an sorted erlang-list.
+
+get_highscore() ->
+ case file:consult("bonk.score") of
+ {ok,[Score_list]} ->
+ {Score_list,"./bonk.score"};
+ {error,_} ->
+ {[],"./bonk.score"}
+ end.
+
+
+%% Prints out the highscorelist and places the new score in the
+%% list if it is high enough.
+
+update_scorelist(SoundPid, Scores) ->
+ case Scores#scores.points of
+ 0 -> true;
+ Score ->
+ {ScoreL,FileName} = get_highscore(),
+ New_scorelist=update_scorelist_2(ScoreL, Score, 0, SoundPid),
+ display_highscore(New_scorelist),
+ case file:open(FileName, write) of
+ {error,_} ->
+ true;
+ {ok,FD} ->
+ io:format(FD,"~w~s~n",[New_scorelist,"."]),
+ file:close(FD)
+ end
+ end.
+
+
+update_scorelist_2([], Score, N, _SoundPid) when N < 10 ->
+ [[integer_to_list(Score),getuser()]];
+
+update_scorelist_2(_, _, N, _SoundPid) when N >= 10 ->
+ [];
+
+update_scorelist_2([[Sc, Name] | Rest], Score, N, SoundPid) ->
+ case list_to_integer(Sc) of
+ Sc_int when Sc_int < Score ->
+ if
+ N == 0 -> SoundPid ! best_score;
+ true -> SoundPid ! high_score
+ end,
+ lists:append([[integer_to_list(Score),getuser()]],
+ update_scorelist_3([[Sc,Name]|Rest],N+1));
+ _Other ->
+ lists:append([[Sc,Name]],update_scorelist_2(Rest, Score, N+1, SoundPid))
+ end.
+
+
+update_scorelist_3([],_) ->
+ [];
+
+update_scorelist_3(_,N) when N >= 10 ->
+ [];
+
+update_scorelist_3([Item|Rest],N) ->
+ lists:append([Item],update_scorelist_3(Rest,N+1)).
+
+getuser() ->
+ case os:type() of
+ {unix,_} ->
+ lists:delete(10,os:cmd("whoami"));
+ _ ->
+ "Unknown"
+ end.
+
+%% Prints out the initial values of scores, bonus, level and bombs.
+
+clear_scores(Scores) ->
+ Score = integer_to_list(Scores#scores.points),
+ Bombs = integer_to_list(Scores#scores.bombs),
+ Bonus = integer_to_list(Scores#scores.bonus),
+ Level = integer_to_list(Scores#scores.level),
+ gs:config(scoreOut,{text,Score}),
+ gs:config(bombOut,{text,Bombs}),
+ gs:config(bonusOut,{text,Bonus}),
+ gs:config(levelOut,{text,Level}).
+
+
+%% Removes everything that is present in the message-que.
+
+flush() ->
+ receive
+ _X ->
+ flush()
+ after
+ 0 ->
+ true
+ end.
+
+sleep(X) ->
+ receive after X -> true end.
+
+%% Opens a window and shows the contents of the file: "bonk.txt".
+%% The window will be removed before the function ends.
+
+display_about() ->
+ {BGColor,TextColor,Bfg} =
+ case get(colormode) of
+ bw -> {black, white, white};
+ _Color -> {black, peachpuff1, orange}
+ end,
+ Wid = 500, Hei = 635,
+ GS = gs:start(),
+ gs:create(window, aboutWin, GS, [{width, Wid}, {height,Hei},
+ {map, false},
+ {bg, BGColor},
+ {title, "About Bonk!"}]),
+ gs:create(canvas, aboutCan, aboutWin, [{width, Wid},{height, Hei},
+ {bg, black}]),
+ gs:create(button, okButton, aboutWin, [{x, Wid div 2 - 50},{y, Hei - 40},
+ {label,{text, "Ok"}}, {click, true},
+ {fg, Bfg}, {bg, BGColor},
+ {relief, flat},
+ {activefg, Bfg},
+ {activebg, BGColor}]),
+ gs:create(text, aboutText, aboutCan, [{width, Wid-30}, {coords, [{15, 0}]},
+ {fg, TextColor}, {justify, center}]),
+ case file:open(lists:append(bonk_dir(),"bonk.txt"), read) of
+ {ok, Fd} ->
+ write_text(Fd, "", io:get_line(Fd, "")),
+ file:close(Fd);
+ {error, _Reason} ->
+ gs:config(aboutText, {text, "Error: could not read the about file"})
+ end,
+
+ gs:config(aboutWin, [{map,true}]),
+ receive
+ {gs, okButton, click, _, _} ->
+ gs:destroy(aboutWin)
+ end.
+
+write_text(_Fd, Text, eof) ->
+ gs:config(aboutText, {text, Text});
+write_text(Fd, Text, More) ->
+ write_text(Fd, lists:append(Text, More), io:get_line(Fd, "")).
diff --git a/lib/gs/contribs/bonk/bonk.gif b/lib/gs/contribs/bonk/bonk.gif
new file mode 100644
index 0000000000..3c2299686b
--- /dev/null
+++ b/lib/gs/contribs/bonk/bonk.gif
Binary files differ
diff --git a/lib/gs/contribs/bonk/bonk.tool b/lib/gs/contribs/bonk/bonk.tool
new file mode 100644
index 0000000000..79ad8f6701
--- /dev/null
+++ b/lib/gs/contribs/bonk/bonk.tool
@@ -0,0 +1,6 @@
+{version,"0.1"}.
+{{tool,"Bonk"},
+ {start,{bonk,start,[]}},
+ {icon,"bonk.gif"},
+ {message,"Bonk - The Game"},
+ {html,"../bonk/bonk.txt"}}.
diff --git a/lib/gs/contribs/bonk/bonk.txt b/lib/gs/contribs/bonk/bonk.txt
new file mode 100644
index 0000000000..69c912dbee
--- /dev/null
+++ b/lib/gs/contribs/bonk/bonk.txt
@@ -0,0 +1,30 @@
+BONK! In Erlang for You
+by
+LENNART OHMAN & MARCUS ARENDT
+
+After an idea of Mike Darweesh.
+Special thanks to Peter Jansson for creating the bitmaps.
+Ported to GS 1.1 by Markus Torpvret and Anders Dahlin.
+
+
+INSTRUCTIONS
+- Hit as many creatures as possible using the left mouse-button.
+- After every 25 hits You will advance one level. For each level You get one bomb.
+- Pushing the middle or right mouse-button, in any square, drops a bomb which
+wipes out everything.
+- The game ends when 10 creatures has escaped from beeing bonked.
+
+
+ABOUT ERLANG
+Erlang is a programming language for building robust concurrent systems. It is a single assignment, symbolic language with built in concurrency. It provides unique facilities for error handling and for reloading updated modules in running systems. Erlang was designed and implemented by Joe Armstrong, Robert Virding, and Mike Williams at Ellemtel (now Ericsson Utvecklings AB).
+
+Please make enquiries about Erlang to:
+
+Ericsson Software Technology AB
+Erlang Systems
+Torshamnsgatan 39B
+Box 1214
+164 28 Kista
+Sweden
+
+http://www.ericsson.se/erlang \ No newline at end of file
diff --git a/lib/gs/contribs/bonk/bonk_sound.erl b/lib/gs/contribs/bonk/bonk_sound.erl
new file mode 100644
index 0000000000..d89ca63e7c
--- /dev/null
+++ b/lib/gs/contribs/bonk/bonk_sound.erl
@@ -0,0 +1,81 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(bonk_sound).
+-export([start/0]).
+
+start() ->
+ random:seed(),
+ sounder:start(),
+ {ok,Bonk}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/bonk.au")),
+ {ok,Ouch}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/ouch!!!.au")),
+ {ok,Damn}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/damn.au")),
+ {ok,Bomb}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/explosion.au")),
+ {ok,Missed}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/missedme.au")),
+ {ok,Game_over}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/gameover.au")),
+ {ok,New_level}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/level.au")),
+ {ok,Music}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/trumpet.au")),
+ {ok,Start}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/hehee.au")),
+ {ok,BestS}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/praisejesus.au")),
+ {ok,HighS}=sounder:new(lists:append(bonk:bonk_dir(),"sounds/yes.au")),
+ loop(Bonk, Ouch, Damn, Bomb, Missed, Game_over, New_level,
+ Music, Start, BestS, HighS).
+
+
+loop(Bonk, Ouch, Damn, Bomb, Missed, Game_over, New_level, Music, Start, BestS, HighS) ->
+ R=random:uniform(1000),
+ receive
+ bonk ->
+ if
+ R < 75 -> play_sound(Damn);
+ R < 275 -> play_sound(Ouch);
+ true -> play_sound(Bonk)
+ end;
+ bomb -> play_sound(Bomb);
+ missed -> play_sound(Missed);
+ game_over -> play_sound(Game_over);
+ new_level -> play_sound(New_level);
+ music -> play_sound(Music);
+ start -> play_sound(Start);
+ best_score -> play_sound(BestS);
+ high_score -> play_sound(HighS);
+ quit ->
+ sounder:stop(),
+ exit(normal)
+ end,
+ loop(Bonk, Ouch, Damn, Bomb, Missed, Game_over, New_level, Music, Start, BestS, HighS).
+
+play_sound(Snd) ->
+ case catch sounder:play(Snd) of
+ {'EXIT', _Reason} ->
+ io:format("Cannot use audio device!\n"),
+ sounder:stop(),
+ silent_loop();
+ _Other ->
+ true
+ end.
+
+silent_loop() ->
+ receive
+ quit ->
+ exit(normal);
+ _Other ->
+ silent_loop()
+ end.
diff --git a/lib/gs/contribs/bonk/bonk_square.erl b/lib/gs/contribs/bonk/bonk_square.erl
new file mode 100644
index 0000000000..2f6c533079
--- /dev/null
+++ b/lib/gs/contribs/bonk/bonk_square.erl
@@ -0,0 +1,145 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(bonk_square).
+-export([start/1,init/5,alarm/3]).
+
+
+
+start(Bmp) ->
+ spawn_link(bonk_square, init, [Bmp, self(),
+ random:uniform(10000),
+ random:uniform(10000),
+ random:uniform(10000)]).
+
+init(Bmp, BoardPid, Seed1, Seed2, Seed3) ->
+ random:seed(Seed1,Seed2,Seed3),
+ idle(Bmp, BoardPid).
+
+
+idle(Bmp, BoardPid) ->
+ receive
+ start ->
+ Level = 1,
+ sleep(Level, Bmp, BoardPid, alarm(sleep_time(Level), wake_up));
+ quit ->
+ exit(normal);
+ _Other ->
+ idle(Bmp, BoardPid)
+ end.
+
+
+sleep(Level, Bmp, BoardPid, Alarm) ->
+ receive
+ stop ->
+ Alarm ! quit,
+ idle(Bmp, BoardPid);
+ quit ->
+ Alarm ! quit,
+ exit(normal);
+ {new_level, NewLevel} ->
+ sleep(NewLevel, Bmp, BoardPid, Alarm);
+ {Alarm, wake_up} ->
+ show_me(BoardPid, Bmp),
+ show(Level, Bmp, BoardPid, alarm(2500, missed));
+ _Other ->
+ sleep(Level, Bmp, BoardPid, Alarm)
+ end.
+
+
+show(Level, Bmp, BoardPid, Alarm) ->
+ receive
+ stop ->
+ Alarm ! quit,
+ idle(Bmp, BoardPid);
+ quit ->
+ Alarm ! quit,
+ exit(normal);
+ {new_level, NewLevel} ->
+ show(NewLevel, Bmp, BoardPid, Alarm);
+ sleep -> % The board was too crowded.
+ Alarm ! quit,
+ sleep(Level, Bmp, BoardPid, alarm(sleep_time(Level), wake_up));
+ bonk ->
+ bonk_me(BoardPid, Bmp),
+ Alarm ! quit,
+ bbmed(Level, Bmp, BoardPid, alarm(1500, hide));
+ bomb ->
+ bomb_me(BoardPid, Bmp),
+ Alarm ! quit,
+ bbmed(Level, Bmp, BoardPid, alarm(1000, hide));
+ {Alarm, missed} ->
+ missed_me(BoardPid, Bmp),
+ bbmed(Level, Bmp, BoardPid, alarm(1500, hide));
+ _Other ->
+ show(Level, Bmp, BoardPid, Alarm)
+ end.
+
+%% bonked, bombed or missed
+bbmed(Level, Bmp, BoardPid, Alarm) ->
+ receive
+ stop ->
+ Alarm ! quit,
+ idle(Bmp, BoardPid);
+ quit ->
+ Alarm ! quit,
+ exit(normal);
+ {new_level, NewLevel} ->
+ bbmed(NewLevel, Bmp, BoardPid, Alarm);
+ {Alarm, hide} ->
+ hide_me(BoardPid, Bmp),
+ sleep(Level, Bmp, BoardPid, alarm(sleep_time(Level), wake_up));
+ _Other ->
+ bbmed(Level, Bmp, BoardPid, Alarm)
+ end.
+
+
+show_me(BoardPid, Bmp) ->
+ BoardPid ! {show, self(), Bmp}.
+
+hide_me(BoardPid, Bmp) ->
+ BoardPid ! {hide, self(), Bmp}.
+
+bonk_me(BoardPid, Bmp) ->
+ BoardPid ! {bonked, self(), Bmp}.
+
+bomb_me(BoardPid, Bmp) ->
+ BoardPid ! {bombed, self(), Bmp}.
+
+missed_me(BoardPid, Bmp) ->
+ BoardPid ! {missed, self(), Bmp}.
+
+
+%% Count sleep time
+
+sleep_time(Level) ->
+ random:uniform((19000 div (Level+1))*2+1500).
+
+%% Set an alarm
+
+alarm(Time, Msg) ->
+ spawn(bonk_square, alarm, [Time, Msg, self()]).
+
+alarm(Time, Msg, Pid) ->
+ receive
+ quit -> exit(normal)
+ after
+ Time -> Pid ! {self(), Msg}
+ end.
diff --git a/lib/gs/contribs/bonk/sounder.erl b/lib/gs/contribs/bonk/sounder.erl
new file mode 100644
index 0000000000..11ab03d167
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounder.erl
@@ -0,0 +1,159 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(sounder).
+-export([start/0,play/1,new/1,go/0,stop/0,nosound/0,silent/0]).
+-include_lib("kernel/include/file.hrl").
+%%----------------------------------------------------------------------
+%% sounder.erl - An interface to /dev/audio
+%%
+%% Created by: {lennarto,mike}@erix.ericsson.se
+%% Modified by: EV,[email protected]
+%%
+%% Mod: 6 Jun 1996 by [email protected]
+%% The executable sounder will no be looked for in the
+%% same directory as from where sounder.jam is loaded.
+%%
+%%
+%% start() - Returns either: ok ,or: silent ,where silent means
+%% that no audio capabilities exists but the sounder
+%% will work "silently" in order to not break any code.
+%%
+%% stop() - Returns: ok
+%%
+%% new(File) - Tries to load the File. At success, a number refering
+%% to the File is returned that shall be used with send/1.
+%% Otherwise {error,Reason} is returned.
+%%
+%% play(No) - Tries to execute the sound registered with the number No
+%% Returns: ok , or: {error,Reason}
+%%
+%% silent() - Returns: true ,if no audio capabilities exists, else: false
+%%
+%% Note: It is also possible to receive: {error,sounder_not_started}
+%%
+%%----------------------------------------------------------------------
+
+start() ->
+ case whereis(sounder) of
+ undefined ->
+ %% first we check if the workstation has audio capabilities
+ case file:read_file_info('/dev/audio') of
+ {ok, FI} when FI#file_info.access==read_write ->
+ register(sounder, spawn(sounder,go,[])),
+ ok;
+ _Other ->
+ register(sounder, spawn(sounder,nosound,[])),
+ silent
+ end;
+ _Pid ->
+ ok
+ end.
+
+stop() ->
+ catch begin check(),
+ sounder ! {stop},
+ ok end.
+
+new(File) when list(File) -> new(list_to_atom(File));
+new(File) when atom(File) ->
+ catch begin check(),
+ sounder ! {new,File,self()},
+ wait_for_ack(sounder) end.
+
+play(No) when integer(No) ->
+ catch begin check(),
+ sounder ! {play, No, self()},
+ wait_for_ack(sounder) end.
+
+silent() ->
+ catch begin check(),
+ sounder ! {play,silent,self()},
+ receive {sounder,Answer} -> Answer end end.
+
+go() ->
+ Port = open_port({spawn,lists:append(bonk:bonk_dir(), "sounder")},[{packet, 2}]),
+ loop(Port).
+
+loop(Port) ->
+ receive
+ {new, File, From} when atom(File) ->
+ Port ! {self(),{command,lists:append([0],atom_to_list(File))}},
+ From ! {sounder,wait_for_ack(Port)},
+ loop(Port);
+ {play,silent,From} ->
+ From ! {sounder,false},
+ loop(Port);
+ {play,No,From} when integer(No) ->
+ Port ! {self(),{command,[No]}},
+ From ! {sounder,wait_for_ack(Port)},
+ loop(Port);
+ {stop} ->
+ Port ! {self(),close},
+ exit(normal);
+ _ ->
+ loop(Port)
+ end.
+
+%% The application using sounds can check on silence itself
+%% and refrain from playing sounds.
+%% Or it can try to play sounds that will be "consumed in silence"
+
+nosound() ->
+ receive
+ {new,File,From} when atom(File) ->
+ From ! {sounder,{ok,silent}},
+ nosound();
+ {play,silent,From} ->
+ From ! {sounder,true},
+ nosound();
+ {play,No,From} when integer(No) ->
+ From ! {sounder,{error,no_audio_cap}},
+ nosound();
+ {stop} ->
+ exit(normal);
+ _ ->
+ nosound()
+ end.
+
+wait_for_ack(sounder) ->
+ receive {sounder,Res} -> Res end;
+wait_for_ack(Port) when port(Port) ->
+ receive
+ {Port,{data,"ok"}} ->
+ ok;
+ {Port,{data,[No]}} ->
+ {ok,No};
+ {Port,{data,Msg}} ->
+ {error,list_to_atom(Msg)};
+ {'EXIT',Port,_} ->
+ exit(port_exited)
+ end.
+
+check() ->
+ case whereis(sounder) of
+ Pid when pid(Pid) ->
+ ok;
+ undefined ->
+ throw({error,sounder_not_started})
+ end.
+
+
+
diff --git a/lib/gs/contribs/bonk/sounds/bonk.au b/lib/gs/contribs/bonk/sounds/bonk.au
new file mode 100644
index 0000000000..5e6518898b
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/bonk.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/damn.au b/lib/gs/contribs/bonk/sounds/damn.au
new file mode 100644
index 0000000000..6117506fb4
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/damn.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/explosion.au b/lib/gs/contribs/bonk/sounds/explosion.au
new file mode 100644
index 0000000000..78a6964f1a
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/explosion.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/gameover.au b/lib/gs/contribs/bonk/sounds/gameover.au
new file mode 100644
index 0000000000..ca7628f3c6
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/gameover.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/hehee.au b/lib/gs/contribs/bonk/sounds/hehee.au
new file mode 100644
index 0000000000..10cd16b596
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/hehee.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/level.au b/lib/gs/contribs/bonk/sounds/level.au
new file mode 100644
index 0000000000..0508c2a6ae
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/level.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/missedme.au b/lib/gs/contribs/bonk/sounds/missedme.au
new file mode 100644
index 0000000000..4c07c9d428
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/missedme.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/music.au b/lib/gs/contribs/bonk/sounds/music.au
new file mode 100644
index 0000000000..ead6ec79b2
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/music.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/ouch!!!.au b/lib/gs/contribs/bonk/sounds/ouch!!!.au
new file mode 100644
index 0000000000..78bcf48074
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/ouch!!!.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/praisejesus.au b/lib/gs/contribs/bonk/sounds/praisejesus.au
new file mode 100644
index 0000000000..e299bf66d6
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/praisejesus.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/trumpet.au b/lib/gs/contribs/bonk/sounds/trumpet.au
new file mode 100644
index 0000000000..2f551b436a
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/trumpet.au
Binary files differ
diff --git a/lib/gs/contribs/bonk/sounds/yes.au b/lib/gs/contribs/bonk/sounds/yes.au
new file mode 100644
index 0000000000..c1ce7dfb69
--- /dev/null
+++ b/lib/gs/contribs/bonk/sounds/yes.au
Binary files differ
diff --git a/lib/gs/contribs/cols/Makefile b/lib/gs/contribs/cols/Makefile
new file mode 100644
index 0000000000..75ca75ffc0
--- /dev/null
+++ b/lib/gs/contribs/cols/Makefile
@@ -0,0 +1,102 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+#
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../../vsn.mk
+VSN=$(GS_VSN)
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/lib/gs-$(VSN)/contribs
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+MODULES= \
+ cols \
+ highscore
+
+HRL_FILES=
+
+ERL_FILES= $(MODULES:%=%.erl)
+
+TARGET_FILES= $(MODULES:%=../ebin/%.$(EMULATOR)) $(TARGET_TOOLBOX_FILES)
+
+TOOLNAME = cols
+
+EXTRA_FILES=
+TOOLBOX_FILES= $(TOOLNAME).tool $(TOOLNAME).gif help.gif
+TARGET_TOOLBOX_FILES= $(TOOLBOX_FILES:%=$(EBIN)/%)
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+ERL_COMPILE_FLAGS +=
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+
+debug opt: $(TARGET_FILES)
+
+docs:
+
+clean:
+ rm -f $(TARGET_FILES)
+ rm -f core
+
+# ----------------------------------------------------
+# Special Build Targets
+# ----------------------------------------------------
+
+$(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif
+ rm -f $@
+ cp $(TOOLNAME).gif $@
+
+$(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool
+ rm -f $@
+ cp $(TOOLNAME).tool $@
+
+$(EBIN)/help.gif: help.gif
+ rm -f $@
+ cp help.gif $@
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_spec: opt
+ $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) $(RELSYSDIR)/cols/bitmaps
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/cols/bitmaps
+ $(INSTALL_DIR) $(RELSYSDIR)/cols
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/cols
+
+release_docs_spec:
+
diff --git a/lib/gs/contribs/cols/cols.erl b/lib/gs/contribs/cols/cols.erl
new file mode 100644
index 0000000000..67b46d0dfb
--- /dev/null
+++ b/lib/gs/contribs/cols/cols.erl
@@ -0,0 +1,618 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(cols).
+
+-export([start/0, init/0]).
+
+%% internal export.
+-export([make_board_elem/3]).
+
+%%======================================================================
+%% Contents
+%%=====================
+%% 1. The actual program
+%% 2. Graphics
+%% 3. Data structures and stuff
+%% 4. Lambdas
+%%======================================================================
+
+
+-define(COLORS, {red,green,blue,grey,yellow,{66,153,130}}).
+-define(HIGHFILE, "./cols.high").
+-define(HEIGHT, 17).
+-define(LEFT, 50).
+-define(SIZE, 15).
+-define(VERSION, "v0.9").
+-define(WIDTH, 8).
+
+-record(state, {bit,board,nextbit,ticks, score=0}).
+%%----------------------------------------------------------------------
+%% Consists of three boxes.
+%%----------------------------------------------------------------------
+-record(bit, {x,y,topColor, middleColor, bottomColor,
+ top_gsobj,mid_gsobj,bot_gsobj}).
+
+%%======================================================================
+%% 1. The actual program
+%%======================================================================
+
+start() ->
+ spawn_link(cols,init,[]).
+
+init() ->
+ make_graphics(),
+ {A,B,C} = erlang:now(),
+ random:seed(A,B,C),
+ NextBit = make_bit(),
+ Board = make_screen_board(),
+ S = #state{bit=make_bit(), board=Board, ticks=update_timer(1),
+ score=make_score(), nextbit=new_bit_xy(NextBit, -2,5)},
+ gs:config(win, [{map, true}]),
+ loop(S).
+
+make_graphics() ->
+ G = gs:start(),
+ H = ?HEIGHT*?SIZE,
+ W = ?WIDTH*?SIZE,
+ BotMargin = 100,
+ gs:create(window, win, G, [{destroy,true},{map, true},{title, "cols"},
+ {height, H+BotMargin}, {width, W+?LEFT+10},
+ {bg, grey},{keypress,true}]),
+ gs:create(canvas, can, win, [{bg, black},
+ {height, H+BotMargin},
+ {width, W+?LEFT+20}]),
+ gs:create(text, can, [{text, "Next"}, {coords, [{5, 45}]}, {fg, red}]),
+ gs:create(image, help, can, [{coords,[{5,7}]},
+ {load_gif, dir() ++ "/help.gif"},
+ {buttonpress,true}]),
+ draw_borders().
+
+loop(State) ->
+ receive
+ Event -> loop(update(Event, State))
+ end.
+
+%%----------------------------------------------------------------------
+%% How fast speed should be doubled
+%%----------------------------------------------------------------------
+-define(DBL_TICKS, 300).
+
+update_timer(Ticks) ->
+ K = 0.001/?DBL_TICKS,
+ M = 1.001-K,
+ Q = K*Ticks+M,
+ Timeout = round(1/math:log(Q)),
+ timer:send_after(Timeout, self(), fall_timeout),
+ Ticks+1.
+
+add_score({ScoreObj, NScore}, DScore) ->
+ NScore2 = NScore + DScore,
+ gs:config(ScoreObj, [{text, io_lib:format("Score: ~w", [NScore2])}]),
+ {ScoreObj, NScore2}.
+
+
+update({gs,_Obj,keypress,_Data, ['Left'|_]}, State) ->
+ #state{bit=Bit, board = Board} = State,
+ #bit{x=X,y=Y} = Bit,
+ if X > 0 ->
+ case is_board_empty(Board, X-1,Y) of
+ true ->
+ State#state{bit=new_bit_xy(Bit, X-1, Y)};
+ false ->
+ State
+ end;
+ true -> State
+ end;
+
+update({gs,_Obj,keypress,_Data, ['Right'|_]}, State) ->
+ #state{bit=Bit, board = Board} = State,
+ #bit{x=X,y=Y} = Bit,
+ if X < ?WIDTH - 1 ->
+ case is_board_empty(Board, X+1, Y) of
+ true ->
+ State#state{bit=new_bit_xy(Bit, X+1, Y)};
+ false ->
+ State
+ end;
+ true -> State
+ end;
+
+update({gs,_Obj,keypress,_Data, ['Up'|_]}, State) ->
+ State#state{bit=shift_bits(State#state.bit)};
+
+update({gs,_Obj,keypress,_Data, [Key|_]}, State) ->
+ case drop_key(Key) of
+ true ->
+ #state{bit=Bit, board=Board, score=Score} = State,
+ #bit{x=X,y=Y} = Bit,
+ {NewX, NewY, NewScore} = drop(X,Y,Score,Board),
+ fasten_bit(State#state{bit=new_bit_xy(Bit,NewX, NewY),
+ score=NewScore});
+ false -> State
+ end;
+
+update(fall_timeout, State) ->
+ #state{bit=Bit, board=Board, ticks = Ticks, score=Score} = State,
+ NewY = Bit#bit.y+1,
+ X = Bit#bit.x,
+ case is_fall_ok(Board, X, NewY) of
+ true ->
+ State#state{bit=new_bit_xy(Bit, X, NewY),
+ ticks=update_timer(Ticks), score=add_score(Score, 1)};
+ false ->
+ S1 = fasten_bit(State),
+ S1#state{ticks=update_timer(Ticks)}
+ end;
+
+update({gs,_,destroy,_,_}, _State) ->
+ exit(normal);
+
+update({gs,help,buttonpress,_,_}, State) ->
+ show_help(),
+ State;
+
+update(OtherEvent, State) ->
+ ok=io:format("got other! ~w~n", [OtherEvent]), State.
+
+drop_key('Down') -> true;
+drop_key(space) -> true;
+drop_key(_) -> false.
+
+is_board_empty(Board, X, Y) ->
+ case {color_at(Board, X, Y),
+ color_at(Board, X, Y + 1),
+ color_at(Board, X, Y + 2)} of
+ {black, black, black} -> true;
+ _ -> false
+ end.
+
+%%----------------------------------------------------------------------
+%% Returns: NewState
+%%----------------------------------------------------------------------
+fasten_bit(State) ->
+ #state{board=Board, bit=Bit, nextbit=NextBit, score=Score} = State,
+ #bit{x=X,y=Y,topColor=C1,middleColor=C2,bottomColor=C3} = Bit,
+ B1 = update_screen_element(Board, X, Y, C1),
+ B2 = update_screen_element(B1, X, Y+1, C2),
+ B3 = update_screen_element(B2, X, Y+2, C3),
+ destroy_bit(Bit),
+ #bit{topColor=NC1,middleColor=NC2,bottomColor=NC3} = NextBit,
+ {B4, ExtraScore} = erase_bits(B3, [{X,Y},{X,Y+1},{X,Y+2}], 0),
+ NewBit = make_bit(NC1,NC2,NC3),
+ case is_board_empty(B4, NewBit#bit.x, NewBit#bit.y) of
+ true ->
+ State#state{score=add_score(Score, ExtraScore),
+ bit=NewBit, nextbit=new_colors(NextBit),board=B4};
+ false ->
+ {_GsObj,Score2}=State#state.score,
+ highscore:run(Score2,?HIGHFILE),
+ exit(normal)
+ end.
+
+%%----------------------------------------------------------------------
+%% Args: Check: list of {X,Y} to check.
+%% Returns: {NewBoard, ExtraScore}
+%%----------------------------------------------------------------------
+erase_bits(Board, Checks, ExtraScore) ->
+ ElemsToDelete = elems2del(Checks,Board,[]),
+ NDel = length(ElemsToDelete),
+ if
+ NDel > 0 ->
+ Board2 = delete_elems(Board, ElemsToDelete),
+ {NewBoard, NewCheck} = fall_down(Board2, ElemsToDelete),
+ if NDel > 3 ->
+ {B,ES}=erase_bits(NewBoard,NewCheck,ExtraScore+2*NDel),
+ {NewBoard2, NewCheck2} = bonus(B, NewCheck),
+ erase_bits(NewBoard2, NewCheck2, ES);
+ true ->
+ erase_bits(NewBoard, NewCheck, 2*NDel)
+ end;
+ true -> {Board, ExtraScore}
+ end.
+
+bonus(Board, Check) ->
+ Cols = collect_bottom_bits(0,Board),
+ NewBoard = randomize_columns(5, Board, Cols),
+ NewCheck = update_check(Check, Cols),
+ {NewBoard, NewCheck}.
+
+randomize_columns(0, Board, _) -> Board;
+randomize_columns(N, Board, Cols) ->
+ NewBoard = randomize_columns(Cols,Board),
+ randomize_columns(N-1, NewBoard, Cols).
+
+randomize_columns([],Board) -> Board;
+randomize_columns([X|Xs],Board) ->
+ flush(),
+ timer:sleep(50),
+ randomize_columns(Xs,update_screen_element(Board,X,?HEIGHT-1,rndColor())).
+
+%%----------------------------------------------------------------------
+%% Returns: NewBoard
+%%----------------------------------------------------------------------
+delete_elems(Board, Elems2Del) ->
+ OrgObjs = org_objs(Elems2Del,Board),
+ visual_effect(?SIZE, OrgObjs),
+ NewBoard = update_board(Elems2Del, Board),
+ put_back(OrgObjs),
+ NewBoard.
+
+visual_effect(0,_OrgObjs) -> done;
+visual_effect(Size,OrgObjs) ->
+ set_size(OrgObjs,Size),
+ flush(),
+ timer:sleep(20),
+ visual_effect(Size-1,OrgObjs).
+
+set_size([],_Size) -> done;
+set_size([{GsObj,[{X1,Y1},{_X2,_Y2}]}|T],Size) ->
+ gs:config(GsObj, [{coords, [{X1,Y1},{X1+Size,Y1+Size}]}]),
+ set_size(T,Size).
+
+%%----------------------------------------------------------------------
+%% Note: Loop over columns where something is removed only. (efficiency)
+%% Returns: {ReversedNewColumns (perhaps shorter), Checks}
+%% cols:fall_column([a,b,black,black,c,f,black,d,black], 3, 15, [], []).
+%% should return: {[a,b,c,f,d],[{3,11},{3,12},{3,13}]}
+%%----------------------------------------------------------------------
+fall_column([], _X, _Y, ColumnAcc, ChecksAcc) ->
+ {ColumnAcc, ChecksAcc};
+fall_column([black|Colors], X, Y, ColumnAcc, ChecksAcc) ->
+ case find_box(Colors) of
+ false -> {ColumnAcc, ChecksAcc};
+ NewColors when list(NewColors) ->
+ fall_one_step(NewColors, X, Y, ColumnAcc, ChecksAcc)
+ end;
+fall_column([Color|Colors], X, Y, ColumnAcc, ChecksAcc) ->
+ fall_column(Colors, X, Y-1, [Color | ColumnAcc], ChecksAcc).
+
+find_box([]) -> false;
+find_box([black|Colors]) ->
+ find_box(Colors);
+find_box([Color|Colors]) -> [Color|Colors].
+
+%%----------------------------------------------------------------------
+%% Enters: ([a,b, , ,c,d], 3, 8, Q)
+%% Leaves: ([b,a|Q], [ , , ,c,d], 10, [{3,8},{4,9}])
+%%----------------------------------------------------------------------
+fall_one_step([], X, Y, ColumnAcc, Checks) ->
+ fall_column([], X, Y, ColumnAcc, Checks);
+fall_one_step([black|Colors], X, Y, ColumnAcc, Checks) ->
+ fall_column([black|Colors], X, Y, ColumnAcc, Checks);
+fall_one_step([Color|Colors], X, Y, ColumnAcc, Checks) ->
+ fall_one_step(Colors, X, Y-1, [Color|ColumnAcc],[{X,Y}|Checks]).
+
+%%----------------------------------------------------------------------
+%% Returns: {NewBoard, NewChecks}
+%%----------------------------------------------------------------------
+fall_down(Board1, Elems2Del) ->
+ UpDatedCols = updated_cols(Elems2Del, []),
+ fall_column(UpDatedCols, Board1, []).
+
+fall_column([], NewBoard, NewChecks) -> {NewBoard, NewChecks};
+fall_column([X|Xs], BoardAcc, ChecksAcc) ->
+ OrgColumn = boardcolumn_to_tuple(BoardAcc, X),
+ Column = columntuple_to_list(OrgColumn),
+ {NewColumn, NewChecksAcc} = fall_column(Column, X,?HEIGHT-1,[],ChecksAcc),
+ NewBoardAcc =
+ set_board_column(BoardAcc,X,new_column_list(NewColumn,OrgColumn)),
+ fall_column(Xs,NewBoardAcc,NewChecksAcc).
+
+new_column_list(NewColumn, ColumnTuple) ->
+ Nempty = ?HEIGHT - length(NewColumn),
+ L = make_list(black, Nempty) ++ NewColumn,
+ new_column_list(L, 1, ColumnTuple).
+
+new_column_list([H|T], N, Tuple) ->
+ {GsObj, Color} = element(N, Tuple),
+ [update_screen_element({GsObj, Color},H) | new_column_list(T, N+1, Tuple)];
+new_column_list([], _, _) -> [].
+
+
+%%----------------------------------------------------------------------
+%% Returns: a reversed list of colors.
+%%----------------------------------------------------------------------
+columntuple_to_list(ColumnTuple) when tuple(ColumnTuple) ->
+ columntuple_to_list(tuple_to_list(ColumnTuple),[]).
+
+columntuple_to_list([],Acc) -> Acc;
+columntuple_to_list([{_GsObj, Color}|T],Acc) ->
+ columntuple_to_list(T,[Color|Acc]).
+
+%%======================================================================
+%% 2. Graphics
+%%======================================================================
+
+make_bit() ->
+ make_bit(rndColor(),rndColor(),rndColor()).
+
+make_bit(Tc,Mc,Bc) ->
+ X = ?WIDTH div 2,
+ Y = 0,
+ #bit{x=X,y=Y,topColor= Tc, middleColor=Mc, bottomColor=Bc,
+ top_gsobj = make_box(X,Y,Tc), mid_gsobj=make_box(X,Y+1,Mc),
+ bot_gsobj=make_box(X,Y+2,Bc)}.
+
+new_colors(Bit) ->
+ #bit{top_gsobj=T,mid_gsobj=M,bot_gsobj=B} = Bit,
+ Tc = rndColor(),
+ Mc = rndColor(),
+ Bc = rndColor(),
+ gs:config(T, [{fill, Tc}]),
+ gs:config(M, [{fill, Mc}]),
+ gs:config(B, [{fill, Bc}]),
+ Bit#bit{topColor= Tc, middleColor=Mc, bottomColor=Bc}.
+
+new_bit_xy(Bit, NewX, NewY) ->
+ #bit{x=X,y=Y,top_gsobj=T,mid_gsobj=M,bot_gsobj=B} = Bit,
+ Dx = (NewX - X) * ?SIZE,
+ Dy = (NewY - Y) * ?SIZE,
+ gs:config(T, [{move, {Dx, Dy}}]),
+ gs:config(M, [{move, {Dx, Dy}}]),
+ gs:config(B, [{move, {Dx, Dy}}]),
+ Bit#bit{x=NewX, y=NewY}.
+
+destroy_bit(#bit{top_gsobj=T,mid_gsobj=M,bot_gsobj=B}) ->
+ gs:destroy(T),
+ gs:destroy(M),
+ gs:destroy(B).
+
+shift_bits(Bit) ->
+ #bit{topColor=C1,middleColor=C2,bottomColor=C3,
+ top_gsobj=T,mid_gsobj=M,bot_gsobj=B} = Bit,
+ gs:config(T, {fill,C2}),
+ gs:config(M, {fill,C3}),
+ gs:config(B, {fill,C1}),
+ Bit#bit{topColor=C2, middleColor=C3, bottomColor=C1}.
+
+rndColor() ->
+ Siz = size(?COLORS),
+ element(random:uniform(Siz), ?COLORS).
+
+make_score() ->
+ {gs:create(text, can, [{text, "Score: 0"}, {fg, red},
+ {coords, [{5,?HEIGHT*?SIZE+10}]}]), 0}.
+
+make_screen_board() ->
+ xy_loop({cols,make_board_elem}, make_board(), ?WIDTH, ?HEIGHT).
+
+make_board_elem(X,Y,Board) ->
+ set_board_element(Board,X,Y,{make_box(X,Y,black),black}).
+
+flush() -> gs:read(can, bg).
+
+draw_borders() ->
+ BotY = ?HEIGHT*?SIZE,
+ RightX = ?LEFT + ?SIZE*?WIDTH,
+ LeftX = ?LEFT - 1,
+ gs:create(line,can,[{coords,[{LeftX,0},{LeftX,BotY}]},{fg,white}]),
+ gs:create(line,can,[{coords,[{LeftX,BotY},{RightX,BotY}]},{fg,white}]),
+ gs:create(line,can,[{coords,[{RightX,0},{RightX, BotY}]}, {fg,white}]).
+
+update_screen_element(ScrBoard, X, Y, Color) ->
+ case board_element(ScrBoard,X,Y) of
+ {_GsObj, Color} ->
+ ScrBoard; % don't have to update screen
+ {GsObj, _ScreenColor} ->
+ gs:config(GsObj, color_args(Color)),
+ set_board_element(ScrBoard, X, Y, {GsObj, Color})
+ end.
+
+update_screen_element(ScrElem, Color) ->
+ case ScrElem of
+ {_GsObj, Color} ->
+ ScrElem; % don't have to update screen
+ {GsObj, _ScreenColor} ->
+ gs:config(GsObj, color_args(Color)),
+ {GsObj, Color}
+ end.
+
+
+color_args(black) -> [{fg,black},{fill,black}];
+color_args(Color) -> [{fg,white},{fill,Color}].
+
+%%======================================================================
+%% 3. Data structures and stuff
+%%======================================================================
+
+xy_loop(Fun, Acc, XMax, YMax) ->
+ xy_loop(Fun, Acc, 0, 0, XMax, YMax).
+
+xy_loop(_Fun, Acc, _X, YMax, _XMax, YMax) -> Acc;
+xy_loop(Fun, Acc, XMax, Y, XMax, YMax) ->
+ xy_loop(Fun, Acc, 0, Y+1, XMax, YMax);
+xy_loop(Fun, Acc, X, Y, XMax, YMax) ->
+ xy_loop(Fun, apply(Fun, [X, Y,Acc]), X+1,Y,XMax, YMax).
+
+%%----------------------------------------------------------------------
+%% Returns: a sorted list of {X,Y} to delete.
+%% Pre: PrevDelElems is sorted.
+%%----------------------------------------------------------------------
+erase_bits_at(Board, PrevDelElems, X,Y) ->
+ C = color_at(Board, X, Y),
+ erase_bits_at([vert, horiz, slash, backslash],X,Y,C,Board,PrevDelElems).
+
+erase_bits_at([], _X,_Y,_C,_Board, Elems2Del) -> Elems2Del;
+erase_bits_at([Dir|Ds],X,Y,C,Board, Elems2DelAcc) ->
+ Dx = dx(Dir),
+ Dy = dy(Dir),
+ DelElems = lists:append(check_dir(Board, X-Dx,Y-Dy,-Dx,-Dy,C),
+ check_dir(Board, X,Y,Dx,Dy,C)),
+ N_in_a_row = length(DelElems),
+ if N_in_a_row >= 3 ->
+ erase_bits_at(Ds,X,Y,C,Board,
+ ordsets:union(lists:sort(DelElems),Elems2DelAcc));
+ true -> erase_bits_at(Ds,X,Y,C,Board,Elems2DelAcc)
+ end.
+
+dx(vert) -> 0;
+dx(horiz) -> 1;
+dx(slash) -> 1;
+dx(backslash) -> -1.
+
+dy(vert) -> -1;
+dy(horiz) -> 0;
+dy(slash) -> -1;
+dy(backslash) -> -1.
+
+
+%%----------------------------------------------------------------------
+%% Returns: list of {X,Y} to delete.
+%%----------------------------------------------------------------------
+check_dir(Board, X, Y, Dx, Dy, Color)
+ when X >= 0, X < ?WIDTH, Y >= 0, Y < ?HEIGHT ->
+ case color_at(Board, X, Y) of
+ Color ->
+ [{X,Y} | check_dir(Board, X+Dx, Y+Dy, Dx, Dy, Color)];
+ _OtherColor ->
+ []
+ end;
+check_dir(_Board, _X, _Y, _Dx, _Dy, _Color) -> [].
+
+make_box(X, Y, Color) ->
+ make_box(X, Y, 1, 1, Color).
+
+%%----------------------------------------------------------------------
+%% Returns: GsObj
+%%----------------------------------------------------------------------
+make_box(X, Y, Height, Width, Color) ->
+ Opts = if Color == black -> [{fg, black}, {fill, black}];
+ true -> [{fill, Color}, {fg, white}] end,
+ gs:create(rectangle, can, [{coords, [{?LEFT + X * ?SIZE, Y * ?SIZE},
+ {?LEFT + X * ?SIZE + (?SIZE*Width)-1,
+ Y * ?SIZE + (?SIZE*Height)-1}]}|Opts]).
+
+is_fall_ok(_Board, _NewX, NewY) when NewY+2 >= ?HEIGHT -> false;
+is_fall_ok(Board, NewX, NewY) ->
+ case color_at(Board, NewX, NewY+2) of
+ black ->
+ true;
+ _ -> false
+ end.
+
+color_at(Board, X, Y) ->
+ {_GsObj, Color} = board_element(Board, X, Y),
+ Color.
+
+
+%%----------------------------------------------------------------------
+%% X:0..?WIDTH-1, Y:0..?HEIGHT
+%%----------------------------------------------------------------------
+make_board() ->
+ list_to_tuple(make_list(make_column(), ?WIDTH)).
+
+board_element(Board, X, Y) ->
+ element(Y+1, element(X+1, Board)).
+
+set_board_element(Board, X, Y, NewValue) ->
+ Col = element(X+1, Board),
+ NewCol=setelement(Y+1,Col, NewValue),
+ setelement(X+1, Board, NewCol).
+
+make_column() ->
+ list_to_tuple(make_list(black, ?HEIGHT)).
+
+make_list(_Elem, 0) -> [];
+make_list(Elem, N) -> [Elem|make_list(Elem,N-1)].
+
+boardcolumn_to_tuple(Board, X) ->
+ element(X+1, Board).
+
+set_board_column(Board, X, NewCol) when length(NewCol) == ?HEIGHT ->
+ setelement(X+1, Board, list_to_tuple(NewCol)).
+
+show_help() ->
+ W = gs:create(window, win, [{title, "cols Help"}, {width, 300},
+ {height,300}, {map, true}]),
+ gs:create(label, W, [{x,0},{y,0},{height, 200},{width,300},{justify,center},
+ {label, {text,
+ "cols $Revision: 1.23 $"
+ "\nby\n"
+ "Klas Eriksson, [email protected]\n\n"
+ "Help: Use arrows and space keys.\n"
+ " Try to get 3 in-a-row.\n"
+ " More than 3 gives bonus."}}]),
+ B=gs:create(button, W, [{x,100},{y,250}, {label, {text, "Dismiss"}}]),
+ receive
+ {gs, B, click, _, _} -> ok
+ end,
+ gs:destroy(W).
+
+%%======================================================================
+%% 4. Lambdas
+%%======================================================================
+
+drop(X,Y,Score,Board) ->
+ case is_fall_ok(Board, X, Y+1) of
+ true -> drop(X,Y+1,add_score(Score, 1),Board);
+ false -> {X,Y, Score}
+ end.
+
+elems2del([], _Board,Elems2DelAcc) -> Elems2DelAcc;
+elems2del([{X,Y}|Checks],Board,Elems2DelAcc) ->
+ NewElems2DelAcc = ordsets:union(erase_bits_at(Board,Elems2DelAcc,X,Y),
+ Elems2DelAcc),
+ elems2del(Checks,Board,NewElems2DelAcc).
+
+collect_bottom_bits(?WIDTH,_Board) -> [];
+collect_bottom_bits(X,Board) ->
+ case color_at(Board, X, ?HEIGHT-1) of
+ black -> collect_bottom_bits(X+1,Board);
+ _AcolorHere -> [X|collect_bottom_bits(X+1,Board)]
+ end.
+
+update_check(_Check,[]) -> [];
+update_check(Check,[X|Xs]) ->
+ case lists:member({X, ?HEIGHT-1}, Check) of
+ true -> update_check(Check,Xs);
+ false -> [{X, ?HEIGHT-1}|update_check(Check,Xs)]
+ end.
+
+org_objs([],_Board) -> [];
+org_objs([{X,Y}|XYs],Board) ->
+ {GsObj, _Color} = board_element(Board, X, Y),
+ [{GsObj, lists:sort(gs:read(GsObj, coords))}|org_objs(XYs,Board)].
+
+update_board([],Board) -> Board;
+update_board([{X,Y}|XYs], Board) ->
+ update_board(XYs,update_screen_element(Board, X, Y, black)).
+
+put_back([]) -> done;
+put_back([{GsObj, Coords}|Objs]) ->
+ gs:config(GsObj, [{coords, Coords}]),
+ put_back(Objs).
+
+updated_cols([], UpdColsAcc) -> UpdColsAcc;
+updated_cols([{X,_Y}|XYs], UpdColsAcc) ->
+ case lists:member(X,UpdColsAcc) of
+ true -> updated_cols(XYs,UpdColsAcc);
+ false -> updated_cols(XYs,[X|UpdColsAcc])
+ end.
+
+%% This is not an application so we don't have their way of knowing
+%% a private data directory where the GIF files are located (this directory).
+%% We can find GS and makes it relative from there /kgb
+
+-define(EbinFromGsPriv,"../contribs/ebin").
+
+dir()->
+ GsPrivDir = code:priv_dir(gs),
+ filename:join(GsPrivDir,?EbinFromGsPriv).
diff --git a/lib/gs/contribs/cols/cols.gif b/lib/gs/contribs/cols/cols.gif
new file mode 100644
index 0000000000..96e7c1ed4a
--- /dev/null
+++ b/lib/gs/contribs/cols/cols.gif
Binary files differ
diff --git a/lib/gs/contribs/cols/cols.tool b/lib/gs/contribs/cols/cols.tool
new file mode 100644
index 0000000000..673c3d8efa
--- /dev/null
+++ b/lib/gs/contribs/cols/cols.tool
@@ -0,0 +1,5 @@
+{version,"0.1"}.
+{{tool,"Cols"},
+ {start,{cols,start,[]}},
+ {icon,"cols.gif"},
+ {message,"Cols - The Game"}}.
diff --git a/lib/gs/contribs/cols/help.gif b/lib/gs/contribs/cols/help.gif
new file mode 100644
index 0000000000..59baef1fec
--- /dev/null
+++ b/lib/gs/contribs/cols/help.gif
Binary files differ
diff --git a/lib/gs/contribs/cols/highscore.erl b/lib/gs/contribs/cols/highscore.erl
new file mode 100644
index 0000000000..9ffbea50a7
--- /dev/null
+++ b/lib/gs/contribs/cols/highscore.erl
@@ -0,0 +1,95 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(highscore).
+
+-export([run/2]).
+
+run(NScore, File) ->
+ Scores = read_scores(File),
+ case find_pos(NScore, 1, Scores) of
+ false ->
+ display(Scores);
+ Pos ->
+ NewScores = new_highscore(Scores, Pos, NScore),
+ write_scores(NewScores,File),
+ display(NewScores)
+ end.
+
+
+new_highscore(Scores, Pos, NScore) ->
+ Txt = io_lib:format("You entered position ~w", [Pos]),
+ W = gs:create(window, gs:start(), [{width, 200},{height, 110},{map,true},
+ {title, "New Highscore!!!"}]),
+ gs:create(label, W, [{label, {text, Txt}}, {x, 0}, {y,0}, {align, center},
+ {width, 190},{height, 30}]),
+ Entry = gs:create(entry, W, [{x, 0}, {y, 40}, {height, 30}, {width, 200}]),
+ Ok = gs:create(button, W, [{label, {text, "Ok"}}, {x, 40}, {y, 75}]),
+ receive
+ {gs, Ok, click, _,_} ->
+ T = gs:read(Entry, text),
+ gs:destroy(W),
+ lists:sublist(lists:reverse(
+ lists:keysort(1, [{NScore, T} | Scores])), 1, 10)
+ end.
+
+
+
+read_scores(File) ->
+ case file:read_file(File) of
+ {ok, Bin} -> binary_to_term(Bin);
+ {error, _Reason} ->
+ mk_empty_high(10)
+ end.
+
+mk_empty_high(0) -> [];
+mk_empty_high(N) -> [{N,"Erlang"}|mk_empty_high(N-1)].
+
+find_pos(_NScore, _N, []) -> false;
+find_pos(NScore, N, [{Score, _Name} | Scores]) when Score > NScore ->
+ find_pos(NScore, N+1, Scores);
+find_pos(_NScore, N, _) -> N.
+
+write_scores(Scores,File) ->
+ file:write_file(File, term_to_binary(Scores)).
+
+display(Scores) ->
+ Win = gs:window(gs:start(), [{width, 300},{height, 250},{map,true},
+ {title, "Highscores"}]),
+ {W,H} = gs:read(Win,{font_wh,{{screen,12},"aaaaaaa"}}),
+ G = gs:grid(Win,[{rows,{1,11}},{columnwidths,[W,4*W]},{hscroll,false},
+ {width, 300},{height, 220},{vscroll,false},
+ {cellheight,H+2},{font,{screen,12}}]),
+ insert_scores(G,2,Scores),
+ Ok = gs:button(Win, [{label, {text, "OK"}}, {x, 100}, {y, 220}]),
+ receive
+ {gs, Ok, click, _,_} -> gs:destroy(Win),
+ ok
+ end.
+
+insert_scores(Grid,_N,[]) ->
+ gs:create(gridline,Grid,[{row,1},{font,{screen,bold,12}},
+ {text,{1,"SCORE"}},{text,{2,"NAME"}}]);
+
+insert_scores(Grid,Row,[{Score,Name}|Ss]) ->
+ gs:create(gridline,Grid,[{row,Row},{text,{1,io_lib:format("~w",[Score])}},
+ {text,{2,Name}}]),
+ insert_scores(Grid,Row+1,Ss).
+
diff --git a/lib/gs/contribs/ebin/.gitignore b/lib/gs/contribs/ebin/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lib/gs/contribs/ebin/.gitignore
diff --git a/lib/gs/contribs/mandel/Makefile b/lib/gs/contribs/mandel/Makefile
new file mode 100644
index 0000000000..61a7a612e0
--- /dev/null
+++ b/lib/gs/contribs/mandel/Makefile
@@ -0,0 +1,100 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+#
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../../vsn.mk
+VSN=$(GS_VSN)
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/lib/gs-$(VSN)/contribs
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+MODULES= \
+ mandel
+
+HRL_FILES=
+
+ERL_FILES= $(MODULES:%=%.erl)
+
+TARGET_FILES= $(MODULES:%=../ebin/%.$(EMULATOR)) $(TARGET_TOOLBOX_FILES)
+
+TOOLNAME = mandel
+
+EXTRA_FILES= $(TOOLNAME).html
+TOOLBOX_FILES= $(TOOLNAME).tool $(TOOLNAME).gif
+TARGET_TOOLBOX_FILES= $(TOOLBOX_FILES:%=$(EBIN)/%)
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+ERL_COMPILE_FLAGS +=
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+
+debug opt: $(TARGET_FILES)
+
+docs:
+
+clean:
+ rm -f $(TARGET_FILES)
+ rm -f core
+
+# ----------------------------------------------------
+# Special Build Targets
+# ----------------------------------------------------
+
+$(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif
+ rm -f $@
+ cp $(TOOLNAME).gif $@
+
+$(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool
+ rm -f $@
+ cp $(TOOLNAME).tool $@
+
+$(EBIN)/help.gif: help.gif
+ rm -f $@
+ cp help.gif $@
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_spec: opt
+ $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) $(RELSYSDIR)/mandel/bitmaps
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/mandel/bitmaps
+ $(INSTALL_DIR) $(RELSYSDIR)/mandel
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/mandel
+
+release_docs_spec:
diff --git a/lib/gs/contribs/mandel/mandel.erl b/lib/gs/contribs/mandel/mandel.erl
new file mode 100644
index 0000000000..d4d2452463
--- /dev/null
+++ b/lib/gs/contribs/mandel/mandel.erl
@@ -0,0 +1,345 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(mandel).
+-author('(mbj,eklas)@erlang.ericsson.se').
+
+%% User's interface
+-export([start/0,start/1]).
+
+%% Internal exports:
+-export([start_client/2,refresher/1,start_server/1,respond/2]).
+
+%%%-----------------------------------------------------------------
+%%% Distributed Mandelbrot program.
+%%% Originally written i C++/rpc/lwp/interviews by Klas Eriksson.(1200 lines)
+%%% Rewritten in Erlang by Klas Eriksson and Martin Bj�rklund.
+%%%-----------------------------------------------------------------
+
+%% unix>erl -sname foo (all nodes will get the same name)
+%% (foo@data)1>mandel:start([{hosts,["computer1","computer2"]},{window,400}]).
+
+%% unix>erl
+%% 1> mandel:start().
+
+-record(state,{image,width,height,xmax,ymax,range,
+ maxiter,colortable,zoomstep}).
+-record(job,{left,right,ymin,ymax,height,width,maxiter,data=[]}).
+-define(JOBWIDTH,10).
+
+%%-----------------------------------------------------------------
+%% This is the client start function.
+%%-----------------------------------------------------------------
+start() ->
+ start([]).
+
+%%----------------------------------------------------------------------
+%% Option is list of Option. Option is:
+%% {xmax,float()}|{ymax,float()}|{range,float()}|
+%% {maxiter,integer()}|{window,integer()}|{zoomstep,float()}|
+%% {hosts,(list of string())|all_found_nodes}
+%%----------------------------------------------------------------------
+start(Opts) ->
+ Nodes1 = nodes(),
+ Nodes = case get_option(hosts,Opts,all_found_nodes) of
+ all_found_nodes when Nodes1 == [] ->
+ N = [node()],
+ spawn(mandel,start_server,[N]),
+ N;
+ all_found_nodes ->
+ start_nodes(dir(),Nodes1),
+ Nodes1;
+ Hosts ->
+ start_slaves(Hosts),
+ start_nodes(dir(),Nodes1),
+ Nodes1
+ end,
+ spawn(mandel,start_client,[Opts,Nodes]).
+
+%% This is not an application so we don't have their way of knowing
+%% a private data directory where the GIF files are located (this directory).
+%% We can find GS and makes it relative from there /kgb
+
+-define(EbinFromGsPriv,"../contribs/ebin").
+
+dir()->
+ GsPrivDir = code:priv_dir(gs),
+ filename:join(GsPrivDir,?EbinFromGsPriv).
+
+
+start_slaves([]) -> ok;
+start_slaves([Host|Hs]) ->
+ {ok,Name}=slave:start(Host),
+ io:format("host ~p is up~n", [Name]),
+ start_slaves(Hs).
+
+start_nodes(_Dir,[]) -> ok;
+start_nodes(Dir,[Node|Nodes]) ->
+ rpc:call(Node,code,add_path,[Dir]), % hack? should be done in .erlang
+ spawn_link(Node,mandel,start_server,[[node()]]),
+ io:format("started mandelserver at node: ~p~n", [Node]),
+ start_nodes(Dir,Nodes).
+
+start_client(Opts,Nodes) ->
+ Wt = get_option(window,Opts,100) div ?JOBWIDTH * ?JOBWIDTH,
+ Ht = get_option(window,Opts,100) div ?JOBWIDTH * ?JOBWIDTH,
+ S=gs:start(),
+ Win=gs:create(window,win1,S,[{title,"Mandel"},{width,Wt-1},{height,Ht-1},
+ {configure,true}]),
+ Canvas=gs:create(canvas,can1,Win,[{width,Wt},{height,Ht}]),
+ Image=gs:image(Canvas,[{buttonpress,true}]),
+ MaxIters = get_option(maxiter,Opts,100),
+ timer:apply_after(8000,mandel,refresher,[Image]),
+ CT = make_color_table(MaxIters),
+ State2=#state{image=Image,width=Wt,height=Ht,
+ xmax=try_random(get_option(xmax,Opts,2),-2,2),
+ ymax=try_random(get_option(ymax,Opts,2),-2,2),
+ range=try_random(get_option(range,Opts,4),0,4),
+ maxiter=MaxIters,colortable=CT,
+ zoomstep=get_option(zoomstep,Opts,1.7)},
+ ToDo = make_jobs(State2),
+ gs:config(Win,[{map,true}]),
+ main(State2, [], Nodes, ToDo).
+
+try_random(random,Low,High) ->
+ random:uniform()*(High-Low)+Low;
+try_random(Float,_Low,_High) when number(Float) -> Float.
+
+
+%%-----------------------------------------------------------------
+%% Distribute work to the nodes. When a node returns, that
+%% node is the first to be used if there's any job left.
+%%-----------------------------------------------------------------
+main(State, [], PassiveNodes, []) ->
+ wait_event(State,[],PassiveNodes,[]);
+main(State, ActiveNodes, PassiveNodes, []) ->
+ % No jobs left, but some nodes are still active.
+ % Wait_Event for their results
+ wait_event(State,ActiveNodes,PassiveNodes,[]);
+main(State, ActiveNodes, [Node|PassiveNodes], [Job|ToDo]) ->
+ % We have work to do, and at least one passive node.
+ % Let him do it.
+ distribute_job(Node, Job),
+ main(State, [Node|ActiveNodes], PassiveNodes, ToDo);
+main(State, ActiveNodes, [], ToDo) ->
+ % We have work to do, but all nodes are active.
+ _Node = wait_event(State,ActiveNodes,[],ToDo).
+
+wait_event(State,ActiveNodes,PassiveNodes,ToDo) ->
+ receive
+ {calculation_done, {Node, Job}} ->
+ if % a small hack. we want to discard data for old pictures
+ Job#job.ymax==State#state.ymax ->
+ draw(State, Node, Job);
+ true -> true
+ end,
+ main(State,lists:delete(Node,ActiveNodes),[Node|PassiveNodes],ToDo);
+ {gs,_Img,buttonpress,_Data,[_Butt,X,Y|_]} ->
+ #state{width=W,height=H,ymax=Ymax,xmax=Xmax,range=R,zoomstep=ZS} =
+ State,
+ RX = Xmax-R+(X/W)*R,
+ RY = Ymax-R+(1-(Y/H))*R,
+ R2 = R/ZS,
+ Xmax2 = RX + R2/2,
+ Ymax2 = RY + R2/2,
+ State2 = State#state{xmax=Xmax2,ymax=Ymax2,range=R2},
+ io:format("{xmax,~w},{ymax,~w},{range,~w}~n", [Xmax2,Ymax2,R2]),
+ ToDo2=make_jobs(State2),
+ main(State2,ActiveNodes,PassiveNodes,ToDo2);
+ {gs,_Win,destroy,_,_} ->
+ kill_nodes(lists:append(ActiveNodes,PassiveNodes));
+ {gs,_Win,configure,_Data,[W,H|_]}
+ when State#state.width==W+1, State#state.height==H+1->
+ main(State,ActiveNodes,PassiveNodes,ToDo);
+ {gs,_Win,configure,_Data,[W|_]} ->
+ gs:config(can1,[{width,W},{height,W}]),
+ gs:config(win1,{configure,false}),
+ gs:config(win1,[{width,W-1},{height,W-1}]),
+ gs:config(win1,{configure,true}),
+ State2 = State#state{width=W,height=W},
+ ToDo2=make_jobs(State2),
+ main(State2,ActiveNodes,PassiveNodes,ToDo2)
+ end.
+
+kill_nodes([]) ->
+ done;
+kill_nodes([Node|Nodes]) ->
+ exit(rpc:call(Node,erlang,whereis,[mandel_server]),kill),
+ kill_nodes(Nodes).
+
+
+distribute_job(Node, Job) ->
+ {mandel_server, Node} ! {mandel_job, {self(), Job}}.
+
+draw(#state{image=Image, width=Wt, height=Ht, xmax=Xmax,
+ maxiter=MI,colortable=ColorTable,range=R}, Node, Job) ->
+ #job{left=Left,data=Data}=Job,
+ io:format("Got data from node ~30w~n", [Node]),
+%% PixelX = K * RealX + M
+%% 0 = K * Xmin + M
+%% Width-1= K * Xmax + M
+ K=(1-Wt)/-R,
+ M=Wt-1-K*Xmax,
+ Xbegin = round(Left*K+M),
+ draw_cols(Image, Xbegin, Ht, lists:reverse(Data),MI,ColorTable).
+
+draw_cols(Image, X, Ht, [H|T],MaxIter,ColorTable) ->
+ draw_col(Image, X, 0, H,MaxIter,ColorTable),
+ draw_cols(Image, X+1, Ht, T,MaxIter,ColorTable);
+draw_cols(_Image, _X, _, [],_MaxIter,_ColorTable) ->
+ done.
+
+draw_col(_Image, _X,_Y,[{no_first_color,0}],_MaxIter,_ColorTable) ->
+ done;
+draw_col(Image, X,Y,[{Color,1}|T],MaxIter,ColorTable) ->
+ gs:config(Image,[{pix_val,{{X,Y},
+ element(Color+1,ColorTable)}}]),
+ draw_col(Image, X,Y+1,T,MaxIter,ColorTable);
+draw_col(Image, X,Y,[{Color,Height}|T],MaxIter,ColorTable) ->
+ gs:config(Image,[{pix_val,{{{X,Y},{X+1,Y+Height}},
+ element(Color+1,ColorTable)}}]),
+ draw_col(Image, X,Y+Height,T,MaxIter,ColorTable).
+
+make_jobs(#state{width=W,height=H,range=R,
+ xmax=Xmax,ymax=Ymax,maxiter=MI}) ->
+ make_jobs(Xmax-R,Xmax,Ymax-R,Ymax,H,W,MI).
+
+make_jobs(Xmin,Xmax,Ymin,Ymax,Ht,Wt,MaxIter) ->
+ NoJobs = Wt/?JOBWIDTH, % Each job is ?JOBWIDTH pixel-col
+ DX = (Xmax - Xmin)/NoJobs,
+ make_jobs(DX,Xmin,Xmax,#job{ymin=Ymin,ymax=Ymax,height=Ht,width=Wt/NoJobs,
+ maxiter=MaxIter},[]).
+
+make_jobs(DX,Left,Xmax,JobSkel,Res) when Left =< Xmax ->
+ Right = Left + DX,
+ Job = JobSkel#job{left=Left,right=Right},
+ make_jobs(DX,Right,Xmax,JobSkel,[Job | Res]);
+make_jobs(_DX,_Left,_Xmax,_JobSkel,Res) -> Res.
+
+%%----------------------------------------------------------------------
+%% A small process that refreshes the screen now and then.
+%%----------------------------------------------------------------------
+refresher(Image) ->
+ gs:config(Image,flush),
+ timer:apply_after(8000,mandel,refresher,[Image]).
+
+%%-----------------------------------------------------------------
+%% This is the server start function.
+%%-----------------------------------------------------------------
+start_server([ClientNode]) ->
+ register(mandel_server, self()),
+ erlang:monitor_node(ClientNode, true),
+ server_loop().
+
+server_loop() ->
+ receive
+ {mandel_job, {Pid, Job}} ->
+ spawn_link(mandel, respond, [Pid, Job]),
+ server_loop()
+ end.
+
+respond(Pid, Job) ->
+ Data = do_job(Job),
+ Pid ! {calculation_done, {node(), Data}}.
+
+do_job(Job) ->
+ calculate_area(Job).
+
+calculate_area(Job) ->
+ #job{ymin=Ymin,ymax=Ymax,height=Ht,width=Wt,left=Xmin,right=Xmax}=Job,
+ Job#job{data=x_loop(0,[],Wt,(Xmax-Xmin)/Wt,(Ymax-Ymin)/Ht,Xmin,Job)}.
+
+x_loop(IX,Res,Wt,Dx,Dy,X,Job) when IX < Wt ->
+ #job{ymin=Ymin,height=Ht,maxiter=MaxIter}=Job,
+ Cols = y_loop(0,Ht,[],MaxIter,Dy,X,Ymin,no_first_color,0),
+ x_loop(IX+1,[Cols|Res],Wt,Dx,Dy,X+Dx,Job);
+x_loop(_,Res,_,_,_,_,_) ->
+ Res.
+
+y_loop(IY,Ht,Res,MaxIter,Dy,X,Y,PrevColor,NprevColor) when IY < Ht ->
+ Color = color_loop(1,MaxIter,0,0,0,0,X,Y),
+ if
+ Color == PrevColor ->
+ y_loop(IY+1,Ht,Res,MaxIter,Dy,X,Y+Dy,PrevColor,NprevColor+1);
+ true ->
+ y_loop(IY+1,Ht,[{PrevColor,NprevColor}|Res],MaxIter,
+ Dy,X,Y+Dy,Color,1)
+ end;
+
+y_loop(_,_,Res,_,_,_,_,PC,N) ->
+ [{PC,N}|Res].
+
+color_loop(Color,MaxIter,Za,Zb,Za2,Zb2,X,Y)
+ when Za2 + Zb2 < 4, Color < MaxIter->
+ Ztmp = Za2 - Zb2 + X,
+ ZbN = 2 * Za * Zb + Y,
+ color_loop(Color+1,MaxIter,Ztmp,ZbN,Ztmp * Ztmp,ZbN * ZbN,X,Y);
+color_loop(MaxIter,MaxIter,_Za,_Zb,_Za2,_Zb2,_X,_Y) ->
+ 0; % black
+color_loop(Color,_,_,_,_,_,_,_) ->
+ Color.
+
+%%----------------------------------------------------------------------
+%% The "colormodel".
+%%----------------------------------------------------------------------
+make_color_table(MaxColors) ->
+ list_to_tuple([{0,0,0}|colors(MaxColors)]).
+
+colors(Ncolors) ->
+ {A,B,C}=erlang:now(),
+ random:seed(A,B,C),
+ Colors = random_colors(Ncolors),
+ Colors2 = best_insert([hd(Colors)],tl(Colors)),
+ Colors2.
+
+random_colors(0) -> [];
+random_colors(N) ->
+ R = random:uniform(256)-1,
+ G = random:uniform(256)-1,
+ B = random:uniform(256)-1,
+ [{R,G,B}|random_colors(N-1)].
+
+best_insert(Sorted,[RGB|Unsorted]) ->
+ best_insert(insert_at(best_pos(RGB,Sorted),RGB,Sorted),Unsorted);
+best_insert(Sorted,[]) -> Sorted.
+
+insert_at(1,Elem,L) -> [Elem|L];
+insert_at(N,Elem,[H|T]) -> [H|insert_at(N-1,Elem,T)].
+
+best_pos(RGB, Sorted) ->
+ D = distances(RGB,Sorted),
+ pos_for_smallest_distance(D,1,1000,-1).
+
+pos_for_smallest_distance([],_CurPos,_SmallestDist,Pos) -> Pos;
+pos_for_smallest_distance([Dist|T],CurPos,SmallDist,_Pos)
+ when Dist < SmallDist ->
+ pos_for_smallest_distance(T,CurPos+1,Dist,CurPos);
+pos_for_smallest_distance([_|T],CurPos,Smallest,Pos) ->
+ pos_for_smallest_distance(T,CurPos+1,Smallest,Pos).
+
+distances(_RGB,[]) ->
+ [];
+distances({R,G,B},[{R2,G2,B2}|T]) ->
+ [lists:max([abs(R-R2),abs(G-G2),abs(B-B2)])|distances({R,G,B},T)].
+
+get_option(Option, Options, Default) ->
+ case gs:assq(Option, Options) of
+ {value, Val} -> Val;
+ false -> Default
+ end.
diff --git a/lib/gs/contribs/mandel/mandel.gif b/lib/gs/contribs/mandel/mandel.gif
new file mode 100644
index 0000000000..49ed1985cb
--- /dev/null
+++ b/lib/gs/contribs/mandel/mandel.gif
Binary files differ
diff --git a/lib/gs/contribs/mandel/mandel.html b/lib/gs/contribs/mandel/mandel.html
new file mode 100644
index 0000000000..afd6ad151f
--- /dev/null
+++ b/lib/gs/contribs/mandel/mandel.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!--
+ ``The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved via the world wide web at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+ Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+ AB. All Rights Reserved.''
+
+ $Id$
+-->
+<HTML>
+<HEAD>
+ <TITLE></TITLE>
+ <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; SunOS 5.5.1 sun4m) [Netscape]">
+</HEAD>
+<BODY>
+
+<H1>Distributed Mandelbrot program</H1>
+
+<P>Originally written i C++/rpc/lwp/interviews by Klas Eriksson.(1200 lines)
+<BR>
+Rewritten in Erlang by Klas Eriksson and Martin Bj&ouml;rklund. </P>
+
+<P><A HREF="http://www.bush.edu/~nick/nick.html">What is the Mandelbrot
+function?</A> </P>
+
+<H2>A small manual</H2>
+
+<UL>
+<LI>Try starting erlang in distributed mode. The mandel program will use<BR>
+all connected nodes for mandel calculations!</LI>
+
+<LI>Resizing the window will restart the calculation.</LI>
+
+<LI>Press left mouse button to zoom.</LI>
+</UL>
+
+<P><TT>mandel:start(list of Option)</TT> can be used to give the program
+different options.</P>
+
+<P><BR>
+Available options are:</P>
+
+<UL>
+<LI>{xmax,float()}</LI>
+
+<LI>{ymax,float()}</LI>
+
+<LI>{range,float()}|</LI>
+
+<LI>{maxiter,integer()}</LI>
+
+<LI>{window,integer()}</LI>
+
+<LI>{zoomstep,float()}</LI>
+
+<LI>{hosts,(list of string())|all_found_nodes}</LI>
+</UL>
+
+<P><BR>
+</P>
+
+</BODY>
+</HTML>
diff --git a/lib/gs/contribs/mandel/mandel.tool b/lib/gs/contribs/mandel/mandel.tool
new file mode 100644
index 0000000000..b59941268e
--- /dev/null
+++ b/lib/gs/contribs/mandel/mandel.tool
@@ -0,0 +1,6 @@
+{version,"0.1"}.
+{{tool,"Mandel"},
+ {start,{mandel,start,[]}},
+ {icon,"mandel.gif"},
+ {message,"Mandelbrot"},
+ {html,"../mandel/mandel.html"}}.
diff --git a/lib/gs/contribs/othello/Makefile b/lib/gs/contribs/othello/Makefile
new file mode 100644
index 0000000000..b81b35fb55
--- /dev/null
+++ b/lib/gs/contribs/othello/Makefile
@@ -0,0 +1,100 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+#
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../../vsn.mk
+VSN=$(GS_VSN)
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/lib/gs-$(VSN)/contribs
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+MODULES= \
+ othello \
+ othello_adt \
+ othello_board
+
+HRL_FILES=
+
+ERL_FILES= $(MODULES:%=%.erl)
+
+TARGET_FILES= $(MODULES:%=../ebin/%.$(EMULATOR)) $(TARGET_TOOLBOX_FILES)
+
+TOOLNAME = othello
+
+EXTRA_FILES=
+TOOLBOX_FILES= $(TOOLNAME).tool $(TOOLNAME).gif
+TARGET_TOOLBOX_FILES= $(TOOLBOX_FILES:%=$(EBIN)/%)
+BITMAPS= priv/marker.bm priv/square.bm
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+ERL_COMPILE_FLAGS +=
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+
+debug opt: $(TARGET_FILES)
+
+docs:
+
+clean:
+ rm -f $(TARGET_FILES)
+ rm -f core
+
+# ----------------------------------------------------
+# Special Build Targets
+# ----------------------------------------------------
+
+$(EBIN)/$(TOOLNAME).gif: $(TOOLNAME).gif
+ rm -f $@
+ cp $(TOOLNAME).gif $@
+
+$(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool
+ rm -f $@
+ cp $(TOOLNAME).tool $@
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_spec: opt
+ $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) $(RELSYSDIR)/othello
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/othello
+ $(INSTALL_DIR) $(RELSYSDIR)/othello/priv
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/othello/priv
+
+release_docs_spec:
+
diff --git a/lib/gs/contribs/othello/othello.erl b/lib/gs/contribs/othello/othello.erl
new file mode 100644
index 0000000000..c66c9c2e79
--- /dev/null
+++ b/lib/gs/contribs/othello/othello.erl
@@ -0,0 +1,236 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(othello).
+-export([start/0,new_game/4,start1/5]).
+
+
+
+%%----------------------------------------------------------------------
+%% The Othello program now uses the gs graphical package instead of the
+%% pxw package. See module othello_board for details
+%%
+%%----------------------------------------------------------------------
+
+
+start() -> othello_board:start().
+
+new_game(Computer,Player,Depth,Init) ->
+ spawn_link(othello,start1,[self(),Computer,Player,Depth,Init]).
+
+start1(Win,Computer,Player,Depth,Init) ->
+ Board = othello_adt:new(t),
+ random:seed(),
+ init_display(Board,Win,Init),
+ play(Computer,Player,Board,Depth,Win,1).
+
+play(Computer,Player,Board,Depth,Win,NoDs) ->
+ tell_win(Win,Computer,Player),
+ case catch continue(Player,Board) of
+ {game_over,Result} ->
+ game_over(Board,Player,Result,Win);
+ {omit_draw,Player} ->
+ omit(Player,Win),
+ play(Computer,swap(Player),Board,Depth,Win,NoDs);
+ ok ->
+ Draw = choose_draw(Computer,Player,Board,Depth,Win,NoDs),
+ Win ! {self(),draw,Draw},
+ Board1 = othello_adt:set(Draw,Player,Board),
+ display(Board1,Board,Win),
+ play(Computer,swap(Player),Board1,Depth,Win,NoDs+1)
+ end.
+
+continue(Player,Board) ->
+ Draws = game_over(Player,Board),
+ not_allowed(Draws,Player),
+ ok.
+
+choose_draw(Computer,Computer,Board,Depth,_Win,NoDs) -> % Depth > 0 !!
+ {Draw,_Value} = alpha_beta(Depth,Board,-11000,11000,Computer,NoDs),
+% io:format('Choosen draw is {~w,~w} : (~w)~n',
+% [othello_adt:col(Draw),othello_adt:row(Draw),Value]),
+% io:format('=====================~n',[]),
+ Draw;
+choose_draw(Computer,Player,Board,Depth,Win,NoDs) ->
+ receive
+ {Win,position,Draw} ->
+ flush(Win),
+ case othello_adt:is_draw(Draw,Player,Board) of
+ false ->
+ Win ! {self(),illegal_draw,Draw},
+ choose_draw(Computer,Player,Board,Depth,Win,NoDs);
+ true ->
+ Draw
+ end
+ end.
+
+flush(Win) ->
+ receive
+ {Win,position,_} ->
+ flush(Win)
+ after 1 ->
+ true
+ end.
+
+tell_win(Win,Computer,Player) ->
+ Win ! {self(),player,Computer,Player},
+ receive
+ {Win,go_on_play} -> true
+ end.
+
+alpha_beta(0,Board,_,_,Player,_) ->
+ {-1,othello_adt:evaluate_board(Player,Board)};
+alpha_beta(Depth,Board,Alpha,Beta,Player,NoDs) ->
+ case compute(Player,Board,NoDs) of
+ [] ->
+ Player1 = swap(Player),
+ case compute(Player1,Board,NoDs) of
+ [] ->
+ dead_lock(Board,Player);
+ PosDraws1 ->
+ choose(PosDraws1,Board,Depth-1,-Beta,-Alpha,-1,
+ Player1,NoDs)
+ end;
+ PosDraws ->
+ choose(PosDraws,Board,Depth-1,-Beta,-Alpha,-1,Player,NoDs)
+% A = choose(PosDraws,Board,Depth-1,-Beta,-Alpha,-1,Player,NoDs),
+% io:format('Alpha-Beta (~w) ==> ~w~n',[Depth,A]),
+% A
+ end.
+
+choose([Draw|Draws],Board,Depth,Alpha,Beta,Record,Player,NoDs) ->
+ Player1 = swap(Player),
+ Board1 = othello_adt:set(Draw,Player,Board),
+% io:format('Alpha <~w> Beta <~w> ~n',[Alpha,Beta]),
+ {_,Value} = alpha_beta(Depth,Board1,Alpha,Beta,Player1,NoDs+1),
+ Value1 = -Value,
+ cutoff(Draw,Value1,Depth,Alpha,Beta,Draws,Board,Record,Player,NoDs);
+choose([],_,_,Alpha,_,Draw,_,_) ->
+ {Draw,Alpha}.
+
+cutoff(Draw,Value,_,_,Beta,_,_,_,_,_) when Value >= Beta ->
+ {Draw,Value};
+cutoff(Draw,Value,Depth,Alpha,Beta,Draws,Board,_,Player,NoDs)
+ when Alpha < Value, Value < Beta ->
+ choose(Draws,Board,Depth,Value,Beta,Draw,Player,NoDs);
+cutoff(Draw,Value,Depth,Alpha,Beta,Draws,Board,Record,Player,NoDs)
+ when Value == Alpha, NoDs < 13 ->
+ choose(Draws,Board,Depth,Alpha,Beta,random_choice(Draw,Record),
+ Player,NoDs);
+cutoff(_Draw,Value,Depth,Alpha,Beta,Draws,Board,Record,Player,NoDs)
+ when Value =< Alpha ->
+ choose(Draws,Board,Depth,Alpha,Beta,Record,Player,NoDs).
+
+compute(Player,Board,NoOfDraws) when NoOfDraws < 13 ->
+ case othello_adt:possible_draws(Player,Board,begin_play) of
+ [] ->
+ othello_adt:possible_draws(Player,Board,playing);
+ Draws ->
+ Draws
+ end;
+compute(Player,Board,_) ->
+ othello_adt:possible_draws(Player,Board,playing).
+
+%%----------------------------------------------------------
+%% Randomly choose between two draws with the same value.
+%%----------------------------------------------------------
+
+random_choice(Draw,Draw1) ->
+ case random:uniform(2) of
+ 1 ->
+ Draw;
+ 2 ->
+ Draw1
+ end.
+
+dead_lock(Board,Player) ->
+ case win_or_loose(Board,Player) of
+ 0 -> {-1,0};
+ Value when Value > 0 -> {-1,10000};
+ _ -> {-1,-10000}
+ end.
+
+win_or_loose(Board,Player) ->
+ Player1 = swap(Player),
+ othello_adt:pieces(Player,Board) - othello_adt:pieces(Player1,Board).
+
+game_over(Player,Board) ->
+ case othello_adt:possible_draws(Player,Board,playing) of
+ [] ->
+ Player1 = swap(Player),
+ case othello_adt:possible_draws(Player1,Board,playing) of
+ [] ->
+ throw({game_over,{{Player,othello_adt:pieces(Player,Board)},
+ {Player1,othello_adt:pieces(Player1,Board)}}});
+ _ ->
+ [] % Player`s Draws !!
+ end;
+ Draws ->
+ Draws
+ end.
+
+game_over(_Board,_Player,Result,Win) ->
+ Win ! {self(),game_over,white_res(Result),black_res(Result)}.
+
+white_res({{white,Res},_}) -> Res;
+white_res({_,{white,Res}}) -> Res.
+
+black_res({{black,Res},_}) -> Res;
+black_res({_,{black,Res}}) -> Res.
+
+not_allowed([],Player) ->
+ throw({omit_draw, Player});
+not_allowed(_,_Player) ->
+ ok.
+
+omit(Player,Win) ->
+ Win ! {self(),omit_draw,Player},
+ receive
+ {Win,continue} ->
+ ok
+ end.
+
+init_display(_Board,_Win,first_time) ->
+ true;
+init_display(Board,Win,_) ->
+ display(Board,Win).
+
+display(Board,Win) ->
+ All = othello_adt:all_pos(Board),
+ display1(All,Win),
+ Win ! {self(),score,othello_adt:pieces(white,Board),
+ othello_adt:pieces(black,Board)}.
+
+display(Board,OldB,Win) ->
+ Diff = othello_adt:diff(Board,OldB),
+ display1(Diff,Win),
+ Win ! {self(),score,othello_adt:pieces(white,Board),
+ othello_adt:pieces(black,Board)}.
+
+display1([{Pos,Colour}|Diff],Win) ->
+ Win ! {self(),new_mark,Pos,Colour},
+ display1(Diff,Win);
+display1(_,_) ->
+ true.
+
+swap(white) -> black;
+swap(black) -> white.
+
+
diff --git a/lib/gs/contribs/othello/othello.gif b/lib/gs/contribs/othello/othello.gif
new file mode 100644
index 0000000000..5970c50209
--- /dev/null
+++ b/lib/gs/contribs/othello/othello.gif
Binary files differ
diff --git a/lib/gs/contribs/othello/othello.tool b/lib/gs/contribs/othello/othello.tool
new file mode 100644
index 0000000000..47550a581d
--- /dev/null
+++ b/lib/gs/contribs/othello/othello.tool
@@ -0,0 +1,6 @@
+{version,"0.1"}.
+{{tool,"Othello"},
+ {start,{othello,start,[]}},
+ {icon,"othello.gif"},
+ {message,"Othello - The Game"},
+ {html,"http://www.armory.com/~iioa/othguide.html"}}.
diff --git a/lib/gs/contribs/othello/othello_adt.erl b/lib/gs/contribs/othello/othello_adt.erl
new file mode 100644
index 0000000000..d1d3ec950b
--- /dev/null
+++ b/lib/gs/contribs/othello/othello_adt.erl
@@ -0,0 +1,539 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(othello_adt).
+-compile(export_all).
+%%-------------------------------------------------------
+%% Use three main states for the strategy:
+%%
+%% BeginPlay: Stay in the inner square as long as possible.
+%% Use the possible_draws/3.
+%%
+%% MiddlePlay: Try to choose stable markers (?)
+%% Use stable/3
+%%
+%% EndPlay: Try to flip as many markers as possible
+%%
+%% The transition from Begin to Middle is obvious. From Middle
+%% to End however, is can be discussed.
+%%-------------------------------------------------------
+
+test(N,B) ->
+ X=new(B),
+ statistics(wall_clock),
+ test0(N,X),
+ {_,T} = statistics(wall_clock),
+ {time_was,T/N}.
+
+
+test0(0,_) -> true;
+test0(N,X) ->
+ possible_draws(black,X,begin_play),
+ test0(N-1,X).
+
+%%-------------------------------------------------------
+%% new/1 - returns a new board
+%%
+%% Uses a tuple for storing the board
+%%-------------------------------------------------------
+
+new(B) ->
+ Board = mk_board(B),
+ {ordsets:from_list([18,19,20,21,26,29,34,37,42,43,44,45]),Board}.
+
+mk_board(t) ->
+ Tup = list_to_tuple(gen_list(64,grey)),
+ Tup1 = setelement(28+1, Tup, white),
+ Tup2 = setelement(35+1, Tup1, white),
+ Tup3 = setelement(27+1, Tup2, black),
+ gen_score_board(),
+ setelement(36+1, Tup3, black).
+
+gen_list(0,_) -> [];
+gen_list(I,Def) -> [Def|gen_list(I-1,Def)].
+
+gen_score_board() -> put(score,list_to_tuple(gen_list(64,0))).
+
+%%-------------------------------------------------------
+%% pos(Col,Row) - returns a position describing column
+%% and row.
+%% Col and Row have the range 1 - 8.
+%%-------------------------------------------------------
+
+pos(Col,Row) -> ((Row - 1) bsl 3) + (Col - 1).
+
+%%-------------------------------------------------------
+%% col(Pos) - returns the column of the Pos position
+%%-------------------------------------------------------
+
+col(Pos) -> (Pos band 7) + 1.
+
+%%-------------------------------------------------------
+%% row(Pos) - returns the row of the Pos position
+%%-------------------------------------------------------
+
+row(Pos) -> (Pos bsr 3) + 1.
+
+%%-------------------------------------------------------
+%% is_draw(Pos,Colour,Board) - returns true if Pos is a
+%% correct draw.
+%%-------------------------------------------------------
+
+is_draw(Pos,Colour,{Bset,Board}) ->
+ case ordsets:is_element(Pos,Bset) of
+ true ->
+ case catch is_good(Colour,Pos,Board) of
+ true ->
+ true;
+ _ ->
+ false
+ end;
+ _ ->
+ false
+ end.
+
+%%-------------------------------------------------------
+%% set(Pos,Colour,Board) - returns an updated board
+%%-------------------------------------------------------
+
+set(Pos,Colour,{Bset,Board}) ->
+ case ordsets:is_element(Pos,Bset) of
+ true ->
+ NewBoard = setelement(Pos+1,Board,Colour),
+ Empty = empty_neighbour(Pos,NewBoard),
+ NewBset = ordsets:union(Empty,ordsets:del_element(Pos,Bset)),
+ turn(Colour,Pos,{NewBset,NewBoard});
+ _ ->
+ {error,invalid_position}
+ end.
+
+empty_neighbour(Pos,Board) ->
+ ordsets:from_list(empty_neighbour(Pos,Board,deltas())).
+
+empty_neighbour(_,_,[]) -> [];
+empty_neighbour(Pos,Board,[H|T]) ->
+ case is_empty(Pos+H,dir(Pos,H),Board) of
+ true -> [Pos+H|empty_neighbour(Pos,Board,T)];
+ _ -> empty_neighbour(Pos,Board,T)
+ end.
+
+is_empty(_,false,_) -> false;
+is_empty(X,_,_Board) when X<0 -> false;
+is_empty(X,_,_Board) when X>63 -> false;
+is_empty(X,_,Board) ->
+ case element(X+1,Board) of
+ grey -> true; % Empty
+ _ -> false
+ end.
+
+%%-------------------------------------------------------
+%% get(Pos,Board) - returns the contents in Pos
+%%-------------------------------------------------------
+
+get(Pos,{_Bset,Board}) -> element(Pos+1,Board).
+
+%%-------------------------------------------------------
+%% pieces(Colour,Board) - returns the number of Colour
+%% pieces.
+%%-------------------------------------------------------
+
+pieces(Colour,{_Bset,Board}) ->
+ pieces(Colour,Board,0,0).
+
+pieces(Colour,Board,Pos,Count) when Pos < 64 ->
+ case element(Pos+1,Board) of
+ Colour ->
+ pieces(Colour,Board,Pos+1,Count+1);
+ _ ->
+ pieces(Colour,Board,Pos+1,Count)
+ end;
+pieces(_,_,_,Count) ->
+ Count.
+
+%%-------------------------------------------------------
+%% possible_draws(Colour, Board, State)
+%%
+%% Returns a list of possible draws regarding the current
+%% strategy state.
+%%-------------------------------------------------------
+
+possible_draws(Colour,{Bset,Board},begin_play) ->
+ Dset = ordsets:intersection(Bset,inner_square()),
+ possible_draws_0(Colour,Dset,Board);
+possible_draws(Colour,{Bset,Board},_) ->
+ possible_draws_0(Colour,Bset,Board).
+
+possible_draws(Colour,{Bset,Board}) ->
+ possible_draws_0(Colour,Bset,Board).
+
+possible_draws_0(_,[],_) -> [];
+possible_draws_0(Colour,[H|T],Board) ->
+ case catch is_good(Colour,H,Board) of
+ true -> [H|possible_draws_0(Colour,T,Board)];
+ false -> possible_draws_0(Colour,T,Board)
+ end.
+
+
+%%-------------------------------------------------------
+%% evaluate_board(Colour,Board) - returns the value of
+%% the board from Colours
+%% point of view.
+%%-------------------------------------------------------
+
+evaluate_board(Colour,{_Bset,Board}) ->
+ Score = get(score), % Initialized (zeroed) score board !!
+ Colour1 = swap(Colour),
+ Score1 = eval_board(Colour,Colour1,Score,Board,0),
+ Score2 = cnt_corner(0,Score1,Board,Colour,Colour1),
+ Score3 = cnt_corner(7,Score2,Board,Colour,Colour1),
+ Score4 = cnt_corner(56,Score3,Board,Colour,Colour1),
+ Score5 = cnt_corner(63,Score4,Board,Colour,Colour1),
+ count(Score5,0).
+% A = count(Score5,0),
+% io:format('Score = ~w~n',[A]),
+% A.
+
+eval_board(MyCol,OtCol,Score,Board,Pos) when Pos < 64 ->
+ case element(Pos+1,Board) of
+ MyCol ->
+ Score1 = setelement(Pos+1,Score,score(Pos)),
+ eval_board(MyCol,OtCol,Score1,Board,Pos+1);
+ OtCol ->
+ Score1 = setelement(Pos+1,Score,-score(Pos)),
+ eval_board(MyCol,OtCol,Score1,Board,Pos+1);
+ _ ->
+ eval_board(MyCol,OtCol,Score,Board,Pos+1)
+ end;
+eval_board(_,_,Score,_,_) ->
+ Score.
+
+cnt_corner(Corner,Score,Board,MyCol,OtCol) ->
+ case element(Corner+1,Board) of
+ MyCol ->
+ cnt_corn(Corner,setelement(Corner+1,Score,50),
+ Board,50,MyCol);
+ OtCol ->
+ cnt_corn(Corner,setelement(Corner+1,Score,-50),
+ Board,-50,OtCol);
+ _ ->
+ Score
+ end.
+
+cnt_corn(0,Score,Board,Value,Colour) ->
+ Score1 = cnt_corn(0,1,8,Score,Board,Value,Colour),
+ cnt_corn(0,8,1,Score1,Board,Value,Colour);
+cnt_corn(7,Score,Board,Value,Colour) ->
+ Score1 = cnt_corn(7,-1,8,Score,Board,Value,Colour),
+ cnt_corn(7,8,-1,Score1,Board,Value,Colour);
+cnt_corn(56,Score,Board,Value,Colour) ->
+ Score1 = cnt_corn(56,1,-8,Score,Board,Value,Colour),
+ cnt_corn(56,-8,1,Score1,Board,Value,Colour);
+cnt_corn(63,Score,Board,Value,Colour) ->
+ Score1 = cnt_corn(63,-1,-8,Score,Board,Value,Colour),
+ cnt_corn(63,-8,-1,Score1,Board,Value,Colour).
+
+cnt_corn(Pos,Dir,LineDir,Score,Board,Value,Colour) ->
+ case dir(Pos,Dir) of
+ Dir ->
+ NextEdge = Pos+Dir,
+ case element(NextEdge+1,Board) of
+ Colour ->
+ Score1 = setelement(NextEdge+1,Score,Value),
+ Score2 = cnt_line(NextEdge,LineDir,Score1,Board,
+ Colour,Value),
+ cnt_corn(NextEdge,Dir,LineDir,Score2,Board,Value,Colour);
+ _ ->
+ Score
+ end;
+ _ ->
+ Score
+ end.
+
+cnt_line(Pos,Dir,Score,Board,Colour,Value) ->
+ case dir(Pos,Dir) of
+ Dir ->
+ OnLinePos = Pos+Dir,
+ case element(OnLinePos+1,Board) of
+ Colour ->
+ Score1 = setelement(OnLinePos+1,Score,Value),
+ cnt_line(OnLinePos,Dir,Score1,Board,Colour,Value);
+ _ ->
+ Score
+ end;
+ _ ->
+ Score
+ end.
+
+count(Score,Pos) when Pos < 64 ->
+ element(Pos+1,Score) + count(Score,Pos+1);
+count(_,_) ->
+ 0.
+
+swap(white) -> black;
+swap(black) -> white.
+
+%%-------------------------------------------------------
+%% stable(Colour,Pos,Board) - returns a value 0-8
+%%
+%% A high value is regarded as more stable than a lower one.
+%% The stability means how many "friendly" neighbours there
+%% are, i.e markers of the same colour. Neighbours positions
+%% outside the board are regarded as friendly.
+%%-------------------------------------------------------
+
+stable(Colour,Pos,{_,Board}) ->
+ stable(deltas(),Colour,Pos,Board).
+
+stable([],_,_,_) -> 0;
+stable([H|T],Colour,Pos,Board) ->
+ stable_val(Colour,Pos,H,Board) + stable(T,Colour,Pos,Board).
+
+stable_val(_,H,D,_) when H+D<0 -> 1;
+stable_val(_,H,D,_) when H+D>63 -> 1;
+stable_val(black,H,D,Board) ->
+ case element((H+D)+1,Board) of
+ black -> 1;
+ _ -> 0
+ end;
+stable_val(white,H,D,Board) ->
+ case element((H+D)+1,Board) of
+ white -> 1;
+ _ -> 0
+ end.
+
+%%-------------------------------------------------------
+%% diff(Board,OldBoard) - return a list of the positions
+%% with changed pieces.
+%% [{Pos1,Colour1},...]
+%%-------------------------------------------------------
+
+diff(Board,OldBoard) -> diff(0,Board,OldBoard).
+
+diff(Pos,Board,OldBoard) when Pos < 64 ->
+ OldP = get(Pos,OldBoard),
+ case get(Pos,Board) of
+ OldP ->
+ diff(Pos+1,Board,OldBoard);
+ NewP ->
+ [{Pos,NewP}|diff(Pos+1,Board,OldBoard)]
+ end;
+diff(_,_,_) ->
+ [].
+
+%%-------------------------------------------------------
+%% all_pos(Board) - return a list of the positions colour.
+%% [{Pos1,Colour1},...]
+%%-------------------------------------------------------
+
+all_pos(Board) -> all_pos(0,Board).
+
+all_pos(Pos,Board) when Pos < 64 ->
+ [{Pos,get(Pos,Board)}|all_pos(Pos+1,Board)];
+all_pos(_,_) ->
+ [].
+
+%%-------------------------------------------------------
+%% Internal stuff
+%%-------------------------------------------------------
+
+deltas() -> [9,8,7,1,-1,-7,-8,-9].
+
+inner_square() ->
+ [18,19,20,21,26,27,28,29,34,35,36,37,42,43,44,45]. % Is already an ordset
+ % Save list traversing.
+% ordsets:list_to_set([18,19,20,21,26,27,28,29,34,35,36,37,42,43,44,45]).
+
+inv(black) -> white;
+inv(white) -> black.
+
+is_good(Colour,H,Board) ->
+ is_good_0(Colour,H,dir(H,-9),Board),
+ is_good_0(Colour,H,dir(H,-8),Board),
+ is_good_0(Colour,H,dir(H,-7),Board),
+ is_good_0(Colour,H,dir(H,-1),Board),
+ is_good_0(Colour,H,dir(H,1),Board),
+ is_good_0(Colour,H,dir(H,7),Board),
+ is_good_0(Colour,H,dir(H,8),Board),
+ is_good_0(Colour,H,dir(H,9),Board),
+ false.
+
+is_good_0(_,_,false,_) -> false;
+is_good_0(_,H,D,_) when integer(H), integer(D), H+D<0 -> false;
+is_good_0(_,H,D,_) when integer(H), integer(D), H+D>63 -> false;
+is_good_0(black,H,D,Board) when integer(H), integer(D) ->
+ case element((H+D)+1,Board) of
+ white -> is_good_1(black,H+D,dir(H+D,D),Board);
+ _ -> false
+ end;
+is_good_0(white,H,D,Board) when integer(H), integer(D) ->
+ case element((H+D)+1,Board) of
+ black -> is_good_1(white,H+D,dir(H+D,D),Board);
+ _ -> false
+ end.
+
+is_good_1(_,_,false,_) -> false;
+is_good_1(_,H,D,_) when integer(H), integer(D), H+D<0 -> false;
+is_good_1(_,H,D,_) when integer(H), integer(D), H+D>63 -> false;
+is_good_1(black,H,D,Board) when integer(H), integer(D) ->
+ case element((H+D)+1,Board) of
+ white -> is_good_1(black,H+D,dir(H+D,D),Board);
+ black -> throw(true);
+ _ -> false
+ end;
+is_good_1(white,H,D,Board) when integer(H), integer(D) ->
+ case element((H+D)+1,Board) of
+ black -> is_good_1(white,H+D,dir(H+D,D),Board);
+ white -> throw(true);
+ _ -> false
+ end.
+
+%%-------------------------------------------------------
+%% turn(Colour,Draw,Board) - returns an updated board
+%% turn all possible pieces
+%% on the board
+%% Neighbours are not changed !!
+%%-------------------------------------------------------
+
+turn(Colour,Draw,{Bset,Board}) ->
+ {Bset,turn(Colour,Draw,-9,
+ turn(Colour,Draw,-8,
+ turn(Colour,Draw,-7,
+ turn(Colour,Draw,-1,
+ turn(Colour,Draw,1,
+ turn(Colour,Draw,7,
+ turn(Colour,Draw,8,
+ turn(Colour,Draw,9,Board))))))))}.
+
+turn(Colour,H,D,Board) ->
+ case catch is_good_0(Colour,H,dir(H,D),Board) of
+ true ->
+ turn_0(Colour,H,D,Board);
+ false ->
+ Board
+ end.
+
+turn_0(_,H,D,B) when integer(H), integer(D), H+D<0 -> B;
+turn_0(_,H,D,B) when integer(H), integer(D), H+D>63 -> B;
+turn_0(black,H,D,Board) when integer(H), integer(D) ->
+ E = H+D,
+ case element(E+1,Board) of
+ white -> turn_0(black,H+D,D,swap(black,E,Board));
+ _ -> Board
+ end;
+turn_0(white,H,D,Board) when integer(H), integer(D) ->
+ E = H+D,
+ case element(E+1,Board) of
+ black -> turn_0(white,H+D,D,swap(white,E,Board));
+ _ -> Board
+ end.
+
+%%-------------------------------------------------------
+%% swap(Colour,Pos,Board) - returns an updated board
+%% turn a piece on the board
+%% Neighbours are not changed !!
+%%-------------------------------------------------------
+
+swap(Colour,Pos,Board) when integer(Pos) ->
+ setelement(Pos+1,Board,Colour).
+
+score(Pos) -> score1({col(Pos),row(Pos)}).
+
+score1({Column,1}) when Column >= 3, Column =< 6 -> 20;
+score1({Column,8}) when Column >= 3, Column =< 6 -> 20;
+score1({1,Line}) when Line >= 3, Line =< 6 -> 20;
+score1({8,Line}) when Line >= 3, Line =< 6 -> 20;
+score1({Column,2}) when Column >= 3, Column =< 6 -> -7;
+score1({Column,7}) when Column >= 3, Column =< 6 -> -7;
+score1({2,Line}) when Line >= 3, Line =< 6 -> -7;
+score1({7,Line}) when Line >= 3, Line =< 6 -> -7;
+score1({Column,Line}) when Column >= 3, Column =< 6,
+ Line >= 3, Line =< 6 -> 1;
+score1({1,1}) -> 100;
+score1({1,8}) -> 100;
+score1({8,1}) -> 100;
+score1({8,8}) -> 100;
+score1({2,1}) -> -30;
+score1({7,1}) -> -30;
+score1({1,2}) -> -30;
+score1({8,2}) -> -30;
+score1({1,7}) -> -30;
+score1({8,7}) -> -30;
+score1({2,8}) -> -30;
+score1({7,8}) -> -30;
+score1({2,2}) -> -50;
+score1({7,2}) -> -50;
+score1({2,7}) -> -50;
+score1({7,7}) -> -50.
+
+%%-------------------------------------------------------
+%% dir(Pos,Dir) - return Dir if allowed direction at Pos.
+%% else return false.
+%%-------------------------------------------------------
+
+dir(0,1) -> 1; % {1,1}
+dir(0,8) -> 8;
+dir(0,9) -> 9;
+dir(0,_) -> false;
+
+dir(7,-1) -> -1; % {8,1}
+dir(7,7) -> 7;
+dir(7,8) -> 8;
+dir(7,_) -> false;
+
+dir(56,-8) -> -8; % {1,8}
+dir(56,-7) -> -7;
+dir(56,1) -> 1;
+dir(56,_) -> false;
+
+dir(63,-9) -> -9; % {8,8}
+dir(63,-8) -> -8;
+dir(63,-1) -> -1;
+dir(63,_) -> false;
+
+dir(Pos,-1) when (Pos bsr 3) == 0 -> -1; % {_,1}
+dir(Pos,1) when (Pos bsr 3) == 0 -> 1;
+dir(Pos,7) when (Pos bsr 3) == 0 -> 7;
+dir(Pos,8) when (Pos bsr 3) == 0 -> 8;
+dir(Pos,9) when (Pos bsr 3) == 0 -> 9;
+dir(Pos,_) when (Pos bsr 3) == 0 -> false;
+
+dir(Pos,-9) when (Pos bsr 3) == 7 -> -9; % {_,8}
+dir(Pos,-8) when (Pos bsr 3) == 7 -> -8;
+dir(Pos,-7) when (Pos bsr 3) == 7 -> -7;
+dir(Pos,-1) when (Pos bsr 3) == 7 -> -1;
+dir(Pos,1) when (Pos bsr 3) == 7 -> 1;
+dir(Pos,_) when (Pos bsr 3) == 7 -> false;
+
+dir(Pos,-8) when (Pos band 7) == 0 -> -8; % {1,_}
+dir(Pos,-7) when (Pos band 7) == 0 -> -7;
+dir(Pos,1) when (Pos band 7) == 0 -> 1;
+dir(Pos,8) when (Pos band 7) == 0 -> 8;
+dir(Pos,9) when (Pos band 7) == 0 -> 9;
+dir(Pos,_) when (Pos band 7) == 0 -> false;
+
+dir(Pos,-9) when (Pos band 7) == 7 -> -9; % {8,_}
+dir(Pos,-8) when (Pos band 7) == 7 -> -8;
+dir(Pos,-1) when (Pos band 7) == 7 -> -1;
+dir(Pos,7) when (Pos band 7) == 7 -> 7;
+dir(Pos,8) when (Pos band 7) == 7 -> 8;
+dir(Pos,_) when (Pos band 7) == 7 -> false;
+
+dir(_Pos,Dir) -> Dir.
+
diff --git a/lib/gs/contribs/othello/othello_board.erl b/lib/gs/contribs/othello/othello_board.erl
new file mode 100644
index 0000000000..0206ba2ded
--- /dev/null
+++ b/lib/gs/contribs/othello/othello_board.erl
@@ -0,0 +1,642 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(othello_board).
+-export([start/0,stop/0,init/0]).
+
+
+%%----------------------------------------------------------------------
+%% The Othello program now uses the gs graphical package instead of the
+%% pxw package.
+%%
+%% Differences are, explanation why and source of change in parenthesis:
+%%
+%% - Buttons looks different (gs feature)
+%% - The black box around "Black to draw" have been removed. (me)
+%% - The Colour and Level menues have been moved directly down to the
+%% 'Status' box. (usability update, my addition)
+%% - The mouse pointer does not change into a watch when the computer
+%% is thinking (not supported in gs)
+%% - Buttons does not flash when being beeped. (not supported in gs)
+%%
+%%
+%% /Peter
+%%
+%%----------------------------------------------------------------------
+
+
+-define(BGCOL,forestgreen).
+
+start() ->
+ spawn(othello_board,init,[]).
+
+stop() ->
+ ok.
+
+%% This is not an application so we don't have their way of knowing
+%% a private data directory where the GIF files are located (this directory).
+%% We can find GS and makes it relative from there /kgb
+
+-define(BitmapPath,"../contribs/othello/priv").
+
+setup_path() ->
+ GsPrivDir = code:priv_dir(gs),
+ Path = filename:join(GsPrivDir,?BitmapPath),
+ put(path,Path).
+
+path() -> get(path).
+
+
+
+%%
+%% The button area are the Quit, Rules buttons at the top of the window.
+%% The Status area is the black and white scores level and colour etc
+%% inbetween the buttons and the othello board.
+%% The board is the 8x8 board where othello battles are fought.
+%%
+init() ->
+ process_flag(trap_exit,true),
+ setup_path(),
+ S = gs:start(),
+ put(windowroot,S), % Ugly global store
+
+ %% Shell coordinates
+ W = 496,
+ H = 636,
+
+ %% Fix top window
+ Shell = gs:create(window, S, [{title,"Othello"},
+ {width, W},{height, H}]),
+
+
+ %% Setup window contents
+
+ setup_buttons(Shell,0,0,W,40), % Fix Menubar
+ setup_status_box(Shell,0,40,W,100), % Fix Status area
+ setup_board(Shell,0,140,496,496), % Combat board
+
+ GamePid = othello:new_game(white,black,1,first_time),
+
+ %% Default settings
+ Options = {white,black,1},
+ %%Wids = {Status,B,W,Dr,Le,Co},
+ Wids = {change,this,at,later,stage,ponto},
+ write_options(Options,Wids),
+
+ gs:config(Shell, {map, true}), %Make win visible
+
+ loop(computer,GamePid,Shell,Wids,Options).
+
+
+
+
+
+
+loop(User,GamePid,Shell,Wids,Options) ->
+ receive
+ {gs,ButtId, click,_ButtId1,[Button]} ->
+ GamePid1 = but_pressed(Button,ButtId,User,GamePid,Shell,
+ Wids,Options),
+ loop(User,GamePid1,Shell,Wids,Options);
+
+ {gs,_, click,_,[MenuItem,_MenuIndex]} ->
+ Ops = menu_selected(MenuItem,User,GamePid,Wids,Options),
+ loop(User,GamePid,Shell,Wids,Ops);
+
+ {'EXIT',GamePid,_} ->
+ loop(User,null,Shell,Wids,Options);
+
+ {'EXIT',_,_} ->
+ loop(User,GamePid,Shell,Wids,Options);
+
+ GameMsg ->
+ game_msg(GameMsg,User,GamePid,Shell,Wids,Options)
+ end.
+
+but_pressed("Quit",_ButtId,_User,_GamePid,_Shell,_Wids,_Op) ->
+ stop(),
+ exit(quit);
+but_pressed("Rules",_ButtId,_User,GamePid,_Shell,_Wids,_Op) ->
+ io:format("No rules, do as you wish~n",[]),
+ GamePid;
+but_pressed("Help",_ButtId,_User,GamePid,_Shell,_Wids,_Op) ->
+ io:format("Othello game~n",[]),
+ io:format("------------~n",[]),
+ io:format(" Put markers by clicking in squares~n",[]),
+ io:format(" Change level by clicking on it~n",[]),
+ io:format(" Change colour by clicking on it~n",[]),
+ io:format("~n",[]),
+ GamePid;
+but_pressed("Newgame",_ButtId,_User,GamePid,_Shell,Wids,Options) ->
+ new_game(GamePid,Wids,Options);
+but_pressed([],ButtId,User,GamePid,_Shell,_Wids,_Op)
+ when pid(GamePid),User == player ->
+ [C,R] = atom_to_list(ButtId),
+ GamePid ! {self(),position,othello_adt:pos(C-96,translate(R-48))},
+ GamePid;
+but_pressed([],ButtId,_User,GamePid,_Shell,_Wids,_Op) ->
+ [C,R] = atom_to_list(ButtId),
+ beep(othello_adt:pos(C-96,translate(R-48))),
+ GamePid;
+but_pressed(Button,ButtId,_User,GamePid,_Shell,_Wids,_Op) ->
+ io:format('Not implemented button pressed ~p, ~p!!!~n',[ButtId,Button]),
+ GamePid.
+
+menu_selected("Black",_User,_GamePid,Wids,Options) ->
+ Op0 = setelement(1,Options,white),
+ Op1 = setelement(2,Op0,white),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("White",_User,_GamePid,Wids,Options) ->
+ Op0 = setelement(1,Options,black),
+ Op1 = setelement(2,Op0,black),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("Black (begin)",_User,_GamePid,Wids,Options) ->
+ Op0 = setelement(1,Options,white),
+ Op1 = setelement(2,Op0,black),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("White (begin)",_User,_GamePid,Wids,Options) ->
+ Op0 = setelement(1,Options,black),
+ Op1 = setelement(2,Op0,white),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("Beginner",_User,_GamePid,Wids,Options) ->
+ Op1 = setelement(3,Options,1),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("Intermediate",_User,_GamePid,Wids,Options) ->
+ Op1 = setelement(3,Options,2),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("Advanced",_User,_GamePid,Wids,Options) ->
+ Op1 = setelement(3,Options,3),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected("Expert",_User,_GamePid,Wids,Options) ->
+ Op1 = setelement(3,Options,4),
+ write_options(Op1,Wids),
+ Op1;
+menu_selected(What,_User,_GamePid,_Wids,Options) ->
+ io:format('Menu item not implemented <~s>~n',[What]),
+ Options.
+
+game_msg(Msg,User,GamePid,Shell,Wids,Options) ->
+ case Msg of
+ {GamePid,new_mark,Pos,Colour} ->
+ new_mark(Pos,Colour),
+ loop(User,GamePid,Shell,Wids,Options);
+
+ {GamePid,illegal_draw,Draw} ->
+ beep(Draw),
+ loop(User,GamePid,Shell,Wids,Options);
+
+ {GamePid,player,Computer,Computer} ->
+ show_player(element(1,Wids),Computer),
+ cursor("watch"),
+ GamePid ! {self(),go_on_play},
+ loop(computer,GamePid,Shell,Wids,Options);
+
+ {GamePid,player,_Computer,Player} ->
+ show_player(element(1,Wids),Player),
+ cursor("top_left_arrow"),
+ GamePid ! {self(),go_on_play},
+ loop(player,GamePid,Shell,Wids,Options);
+
+ {GamePid,omit_draw,Player} ->
+ omit_draw(GamePid,Player),
+ loop(User,GamePid,Shell,Wids,Options);
+
+ {GamePid,score,WhiteRes,BlackRes} ->
+ write_score(Wids,WhiteRes,BlackRes),
+ loop(User,GamePid,Shell,Wids,Options);
+
+ {GamePid,draw,Draw} ->
+ write_draw(Wids,Draw),
+ loop(User,GamePid,Shell,Wids,Options);
+
+ {GamePid,game_over,WhiteRes,BlackRes} ->
+ game_over(WhiteRes,BlackRes),
+ loop(User,GamePid,Shell,Wids,Options);
+
+ What ->
+ io:format('game_msg received: ~w~n',[What]),
+ loop(User,GamePid,Shell,Wids,Options)
+ end.
+
+
+new_game(GamePid,Wids,Options) when pid(GamePid) ->
+ exit(GamePid,kill),
+ new_game(Wids,Options);
+new_game(_,Wids,Options) ->
+ new_game(Wids,Options).
+
+new_game(_Wids,Options) ->
+ label("",lastdraw),
+ Computer = element(1,Options),
+ Start = element(2,Options),
+ Depth = element(3,Options),
+ othello:new_game(Computer,Start,Depth,restart).
+
+new_mark(Pos,Colour) ->
+ Col = othello_adt:col(Pos),
+ Row = othello_adt:row(Pos),
+ Name = [Col+96,translate(Row)+48],
+ Button = get(Name),
+ butbit(Button,Colour).
+
+beep(Draw) ->
+ Col = othello_adt:col(Draw),
+ Row = othello_adt:row(Draw),
+ Name = [Col+96,translate(Row)+48],
+ Button = get(Name),
+ bell(Button).
+
+show_player(_Status,white) ->
+ label("White to draw",todraw);
+show_player(_Status,black) ->
+ label("Black to draw",todraw).
+
+write_score(_Wids,WhiteRes,BlackRes) ->
+ label(integer_to_list(BlackRes),bscore),
+ label(integer_to_list(WhiteRes),wscore).
+
+write_draw(_Wids,Draw) ->
+ Col = othello_adt:col(Draw),
+ Row = othello_adt:row(Draw),
+ label(lists:flatten(io_lib:format('{~w,~w}',[Col,Row])), lastdraw).
+
+write_options(Options,Wids) ->
+ write_colour(Options,Wids),
+ write_level(Options,Wids).
+
+write_colour(Options,Wids) ->
+ write_colour(element(1,Options),element(2,Options),Wids).
+
+write_colour(black,white,_Wids) -> label("White (begin)",colour);
+write_colour(black,black,_Wids) -> label("White",colour);
+write_colour(white,black,_Wids) -> label("Black (begin)",colour);
+write_colour(white,white,_Wids) -> label("Black",colour).
+
+write_level(Options,_Wids) ->
+ case element(3,Options) of
+ 1 -> label("Beginner",level);
+ 2 -> label("Intermediate",level);
+ 3 -> label("Advanced",level);
+ 4 -> label("Expert",level)
+ end.
+
+cursor(_What) ->
+ done.
+%cursor(What) -> cursor(get(),What).
+
+%cursor([{[C,R],Button}|Buts],What) ->
+% set_widget(Button,"cursor",What),
+% cursor(Buts,What);
+%cursor([_|Buts],What) ->
+% cursor(Buts,What);
+%cursor([],_) ->
+% true.
+
+translate(1) -> 8;
+translate(2) -> 7;
+translate(3) -> 6;
+translate(4) -> 5;
+translate(5) -> 4;
+translate(6) -> 3;
+translate(7) -> 2;
+translate(8) -> 1.
+
+bitmap(grey) -> bitmap_path("square.bm");
+bitmap(black) -> bitmap_path("marker.bm");
+bitmap(white) -> bitmap_path("marker.bm").
+
+bitmap_path(Bitmap) ->
+ filename:join(path(),Bitmap).
+
+xy_position([[Letter,Digit],_,_]) ->
+ LettPos = Letter - 97,
+ X = LettPos*60 ,
+ Y = (8 - list_to_integer([Digit])) * 60,
+ {X+6,Y+6};
+xy_position(X) ->
+ io:format("xy_position: ~w~n",[{error,X}]).
+
+
+board() ->
+ [["a1",grey,nil],
+ ["b1",grey,nil],
+ ["c1",grey,nil],
+ ["d1",grey,nil],
+ ["e1",grey,nil],
+ ["f1",grey,nil],
+ ["g1",grey,nil],
+ ["h1",grey,nil],
+
+ ["a2",grey,nil],
+ ["b2",grey,nil],
+ ["c2",grey,nil],
+ ["d2",grey,nil],
+ ["e2",grey,nil],
+ ["f2",grey,nil],
+ ["g2",grey,nil],
+ ["h2",grey,nil],
+
+ ["a3",grey,nil],
+ ["b3",grey,nil],
+ ["c3",grey,nil],
+ ["d3",grey,nil],
+ ["e3",grey,nil],
+ ["f3",grey,nil],
+ ["g3",grey,nil],
+ ["h3",grey,nil],
+
+ ["a4",grey,nil],
+ ["b4",grey,nil],
+ ["c4",grey,nil],
+ ["d4",white,nil],
+ ["e4",black,nil],
+ ["f4",grey,nil],
+ ["g4",grey,nil],
+ ["h4",grey,nil],
+
+ ["a5",grey,nil],
+ ["b5",grey,nil],
+ ["c5",grey,nil],
+ ["d5",black,nil],
+ ["e5",white,nil],
+ ["f5",grey,nil],
+ ["g5",grey,nil],
+ ["h5",grey,nil],
+
+ ["a6",grey,nil],
+ ["b6",grey,nil],
+ ["c6",grey,nil],
+ ["d6",grey,nil],
+ ["e6",grey,nil],
+ ["f6",grey,nil],
+ ["g6",grey,nil],
+ ["h6",grey,nil],
+
+ ["a7",grey,nil],
+ ["b7",grey,nil],
+ ["c7",grey,nil],
+ ["d7",grey,nil],
+ ["e7",grey,nil],
+ ["f7",grey,nil],
+ ["g7",grey,nil],
+ ["h7",grey,nil],
+
+ ["a8",grey,nil],
+ ["b8",grey,nil],
+ ["c8",grey,nil],
+ ["d8",grey,nil],
+ ["e8",grey,nil],
+ ["f8",grey,nil],
+ ["g8",grey,nil],
+ ["h8",grey,nil]].
+
+
+omit_draw(GamePid,Player) ->
+% %% Find mouse coords first
+% %% This was not possible in gs
+
+ W = 200, H = 100, Root = get(windowroot),
+ Box = gs:create(window, Root, [{title,"OMIT"}, {width, W},{height, H}]),
+
+ mk_label_c(lists:flatten(io_lib:format('~w has to omit draw !',[Player])),
+ Box, W, 10),
+
+ mk_button_c("Ok", Box, W, H-40, 80, 30),
+
+ gs:config(Box, {map, true}), %Make win visible
+
+ receive
+ {gs,_, click,_,["Ok"]} ->
+ gs:destroy(Box),
+ GamePid ! {self(),continue}
+ end.
+
+game_over(WhiteRes,BlackRes) ->
+% %% Find mouse coords first
+% %% This was not possible in gs
+
+ W = 200, H = 160,
+ Root = get(windowroot),
+ Box = gs:create(window, Root, [{title,"GAME OVER"},
+ {width, W},{height, H}]),
+
+ mk_label_c("GAME OVER", Box, W, 10),
+
+ mk_label_c(lists:flatten(io_lib:format('White score: ~w',[WhiteRes])),
+ Box,W,40),
+ mk_label_c(lists:flatten(io_lib:format('Black score: ~w',[BlackRes])),
+ Box,W,70),
+
+ mk_button_c("Ok", Box, W, H-40, 80, 30),
+
+ gs:config(Box, {map, true}), %Make win visible
+
+ receive
+ {gs,_, click,_,["Ok"]} ->
+ gs:destroy(Box)
+ end.
+
+
+
+%% ----------------------------------------------------------------
+%% Library functions.
+%% ----------------------------------------------------------------
+
+bell(Widget) ->
+ %% gs does not support bells,
+ Widget.
+
+label(Text,Label) ->
+ gs:config(Label,[{label,{text,Text}}]).
+
+%% mk_label in centered version
+mk_label_c(Label,Parent,Width,Y) ->
+ W = 8*length(Label),
+ X = trunc((Width-W)/2),
+ gs:create(label,Parent,[{width,W}, {height, 20}, {x,X}, {y,Y},
+ {label, {text, Label}}]).
+
+
+
+
+setup_buttons(Shell,X,Y,W,H) ->
+ ButBox = gs:create(frame, Shell,[{x,X}, {y,Y},{bg,white},
+ {width,W}, {height,H}]),
+ C = gs:create(canvas,ButBox,[{x,X}, {y,Y}, {width, W}, {height, H},
+ {bg,white}]),
+ gs:create(line, C, [{coords, [{0,H-1},{W,H-1}]}]),
+
+
+ mk_button("Quit",ButBox, 10, 10, 70, 20),
+ mk_button("Rules",ButBox, 80, 10, 70, 20),
+ mk_button("Newgame",ButBox, 150, 10, 70, 20),
+ mk_button("Help",ButBox, 220, 10, 70, 20),
+%% mk_button("Level",ButBox, 290, 10, 70, 20),
+
+ done.
+
+
+
+
+
+%%----------------------------------------
+%% Sets up the middle window w. all the status info in.
+%% The labels are given names:
+%% bscore, wscore, lastdraw, todraw, level and colour to simplify
+%% their frequent setting
+%%
+setup_status_box(Shell,X,Y,W,H) ->
+ F = gs:create(frame, Shell,[{x,X}, {y,Y},
+ {width,W}, {height,H},{bg,white}]),
+ C = gs:create(canvas,F,[{x,0}, {y,0}, {width, W}, {height, H},{bg,white}]),
+ gs:create(line, C, [{coords, [{0,H-1},{W,H-1}]}]),
+
+ %% Left side
+ gs:create(label,F,[{align,w},{x,10}, {y,5}, {width, 100},
+ {label,{text, "Black score:"}},{bg,white}]),
+ gs:create(label,bscore,F,[{align,w},{x,110}, {y,5}, {width, 40},
+ {label,{text, "2"}},{bg,white}]),
+ gs:create(label,F,[{align,w},{x,10}, {y,35}, {width, 100},
+ {label,{text, "White score:"}},{bg,white}]),
+ gs:create(label,wscore,F,[{align,w},{x,110}, {y,35}, {width, 40},
+ {label,{text, "2"}},{bg,white}]),
+ gs:create(label,F,[{align,w},{x,10}, {y,65}, {width, 100},
+ {label,{text, "Last draw:"}},{bg,white}]),
+ gs:create(label,lastdraw,F,[{align,w},{x,110}, {y,65}, {width, 40},
+ {label,{text, ""}},{bg,white}]),
+
+
+ %% Right side
+ X2 = trunc(W/2)+10,
+ gs:create(label,todraw,F,[{align,w},{x,X2}, {y,5}, {width, 100},
+ {label,{text, "Black to draw:"}},{bg,white}]),
+
+ gs:create(label,F,[{align,w},{x,X2}, {y,35}, {width, 80},
+ {label,{text, "Level:"}},{bg,white}]),
+ setup_level_menu(F,X2+80,35),
+
+%% gs:create(label,level,F,[{align,w},{x,X2+80}, {y,35}, {width, 130},
+%% {label,{text, "Intermediate"}},{bg,white}]),
+ gs:create(label,F,[{align,w},{x,X2}, {y,65}, {width, 80},
+ {label,{text, "Colour:"}},{bg,white}]),
+ setup_col_menu(F,X2+80,65),
+
+%% gs:create(label,colour,F,[{align,w},{x,X2+80}, {y,65}, {width, 120},
+%% {label,{text, "black (begin)"}},{bg,white}]),
+
+ done.
+
+
+setup_col_menu(P,X,Y) ->
+ MB = gs:create(menubutton,colour,P,
+ [{x,X}, {y,Y}, {bw,3},
+ %%{width,W}, {height,H},
+ {align,w}, {bg,white},
+ {relief, raised},
+ {activefg,white}, {activebg,black},
+ {label, {text,"Colours"}}]),
+
+ M = gs:create(menu,MB,[]),
+ gs:create(menuitem,M,[{label,{text,"Black (begin)"}}]),
+ gs:create(menuitem,M,[{label,{text,"Black"}}]),
+ gs:create(menuitem,M,[{label,{text,"White (begin)"}}]),
+ gs:create(menuitem,M,[{label,{text,"White"}}]),
+ done.
+
+setup_level_menu(P,X,Y) ->
+ MB = gs:create(menubutton,level,P,
+ [{x,X}, {y,Y},
+ %%{width,W}, {height,H},
+ {relief, raised},
+ {activefg,white}, {activebg,black},
+ {align,w}, {bg,white},
+ {label, {text,"Colours"}}]),
+
+ M = gs:create(menu,MB,[]),
+ gs:create(menuitem,M,[{label,{text,"Beginner"}}]),
+ gs:create(menuitem,M,[{label,{text,"Intermediate"}}]),
+ gs:create(menuitem,M,[{label,{text,"Advanced"}}]),
+ gs:create(menuitem,M,[{label,{text,"Expert"}}]),
+ done.
+
+
+setup_board(Shell,X,Y,W,H) ->
+ F = gs:create(frame, Shell,[{x,X}, {y,Y},
+ {width,W}, {height,H},{bg,white}]),
+ display_board(F).
+
+
+mk_button(Label, Parent, X, Y, W, H) ->
+ gs:create(button,Parent,[{width,W}, {height, H}, {x,X}, {y,Y},
+ {label, {text, Label}}, {bg,white},
+ {activefg,white}, {activebg,black}]).
+
+%% Centers a button around Width
+mk_button_c(Label, Parent, Width, Y, W, H) ->
+ X = trunc((Width-W)/2),
+ gs:create(button,Parent,[{width,W}, {height, H}, {x,X}, {y,Y},
+ {label, {text, Label}}, {bg,white}]).
+
+
+butbit(Button,Col) ->
+ gs:config(Button,[
+ {label,{image,bitmap(Col)}},
+ {fg, Col},
+ {activefg,Col},
+ {label, {image, bitmap(Col)}}]),
+ Button.
+
+mk_board_butt(Top,Name,X,Y,Col) ->
+ B = gs:create(button,list_to_atom(Name), Top,
+ [{x,X}, {y,Y}, {width,60}, {height,60},
+ {padx,5},{pady,5},
+ {relief,flat},
+ {bg,?BGCOL}, {activebg,?BGCOL}]),
+ butbit(B,Col),
+ B.
+
+
+
+display_board(Top) ->
+ Board = board(),
+ display_board(Top,Board,1).
+
+display_board(_,_,65) -> true;
+display_board(Top,[H|T],Place) ->
+ [Name,Colour,_] = H,
+ {X,Y} = xy_position(H),
+ Button = mk_board_butt(Top,Name,X,Y,Colour),
+ %%Button = mk_button("",Name,Top,X,Y,60,60),
+ put(Name,Button),
+ %%Bitmap = bitmap(Colour),
+ %%butbit(Button,Bitmap),
+ %%set_widget(Button,"internalWidth","1"),
+ %%set_widget(Button,"internalHeight","1"),
+ %%borderWidth(2,Button),
+ display_board(Top,T,Place+1).
+
+
diff --git a/lib/gs/contribs/othello/priv/marker.bm b/lib/gs/contribs/othello/priv/marker.bm
new file mode 100644
index 0000000000..fe7f3df820
--- /dev/null
+++ b/lib/gs/contribs/othello/priv/marker.bm
@@ -0,0 +1,43 @@
+#define marker2_width 60
+#define marker2_height 60
+static unsigned char marker2_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+ 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
+ 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff,
+ 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
+ 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff,
+ 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
+ 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
+ 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x00, 0xc0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x7f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0x00,
+ 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff,
+ 0xff, 0x3f, 0x3f, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x3f, 0x00,
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xcf, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xc7, 0x0f, 0x00,
+ 0x00, 0xfc, 0xff, 0xff, 0xff, 0xe7, 0x07, 0x00, 0x00, 0xf8, 0xff, 0xff,
+ 0x7f, 0xf1, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xbf, 0xfc, 0x03, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0x59, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lib/gs/contribs/othello/priv/square.bm b/lib/gs/contribs/othello/priv/square.bm
new file mode 100644
index 0000000000..4e6880b330
--- /dev/null
+++ b/lib/gs/contribs/othello/priv/square.bm
@@ -0,0 +1,43 @@
+#define square_width 60
+#define square_height 60
+static unsigned char square_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};