Article
· Mar 17, 2020 2m read

SEA BATTLE on EXCEL

The client part of the code for this game is on the MS Excel sheet and consists of:

  1. m-commands  for random arranging ships on the playing field  (21 cells)
  2. m-command to enable on-click m-trigger on all 100 cells of the playing field (1), red font
  3. m-trigger (1), red font

The server part of the code (vmx.ro) is installed onсе, it not change depending on the task, is the same for IRIS, CACHE, 16, 8-bit encoding, any applications, games, reports.  The server side creates and maintains ‘virtual excel’ in M.

SEA BATTLE can be tested without your mx-server, just download MX  and unzip to any folder  on comp with MS Excel, then run mx-sea-battle.xlsb, press big top button (51).

The empty square of 10 by 10 cells will appear. Ship will unhide on click, the last section will red.  For restart press “R”.

 

 

You can install mx-server IRIS (tested for Ubuntu 18.04.4 LTS) :

unzip MX to any folder  /path/to/mymx, then :

$ docker  run  --name  myiris  -p 5264:5264 -v /path/to/mymx:/mx  -d  store/intersystems/iris-community:2020.1.0.202.0

$ docker exec  -it myiris iris session iris

USER>do $System.OBJ.ImportDir(“/mx”,”vmx.ro”,”ck”,,1)

USER> do ^ZSTU

On clients side (any comp with Windows & MS Excel) :

  1. unzip MX to any folder
  2. open mx_confi.xlsb,  see sheet ‘mx-sea-battle’,  row 59
  3. change ‘localhost’ in row 59 to IP4-address of mx-server (example : 192.168.1.106)
  4. save this workbook

Run mx-sea-battle.xlsb, then press button 59 to connect with IRIS.

 

To see what is hidden under bonnet on the client side, just click ‘design’ icon on the top panel.

Under Windows, mx-server and mx-client can be the same comp, row 59 as is.

Best wishes

Alex

Discussion (0)0
Log in or sign up to continue