Wanted: board-setup code automaticall... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Desired Features for Zillions of Games » Wanted: board-setup code automatically generated « Previous Next »

Author Message
Karl Scherer (Karl)
Posted on Wednesday, March 30, 2005 - 6:51 pm:   

When a board setup with many pieces is generated by
random moves and drops, often it is desirable to
use this setup in a variant as a fixed setup
for puzzles etc.

Keying in the sometimes hundreds of positions
(games Stepping Stones, Drop etc) is too tedious
on the long run to do by hand.
I have asked Jeff Mallet to create a menu option
which could create board-setup content
(player/piece/position code)
automatically from a given zsg.

Alfred Pfeiffer from Germany now has shown me
how to do such a generation with a single program call to the "awk" utility,
free to download (under the name "gawk") from the internet:

# awk '/?Rand/ {a[$6]=a[$6] " " $7} END {for (p in a) {print "(" p a[p] ")"}}'
game1.zsg >game1.inc


Explanations:
-------------

# Prompt

awk Program name.

' ... ' Programmskript.
Put it in apostrophies to have the shell (command interpreter) ignore it.
Will be passed as first parameter to the program "awk".

game1.zsg Name of input file

>game1.inc Name of Outputfile ('>' for file redirection)

.....................
This way Alfred and me managed to create the
large fixed board setups in my new games
"Drop", "Stepping Stones", and "Odd Ones".

The use of awk showed to us that the requested
Zillions feature would make a big difference in
creating games with large boards setups.

I strongly hope that the next Zillions version
has this nice feature included!
Cheers, Karl
Karl Scherer (Karl)
Posted on Saturday, April 02, 2005 - 7:04 pm:   

Of course the Zillions version if this board-setup
generator wouldn't need a zsg as input;
it would just work on any current board situation.
This makes it much simpler than the awk technique.
Karl Scherer (Karl)
New member
Username: Karl

Post Number: 387
Registered: 9-2000
Posted on Thursday, October 13, 2011 - 5:59 am:   

Another way to avoid the setup-problem is to use
lists (menus) which let you choose from a selection of zsg files, see my games ArrowWay, Crystal and many others.
Greg Schmidt (Gschmidt2)
New member
Username: Gschmidt2

Post Number: 137
Registered: 1-2007
Posted on Thursday, October 13, 2011 - 7:36 am:   

Axiom provides a way to do this. It does mean that for pure zrf games, you would need to run the ZRF converter and add "drops" capability to your game, include "GenerateBoardSetup.4th", enough to define an initial setup..., make your setup using edits, exit, then the setup would be in <game.log> Probably too big of a deal for most. A more direct option would be to write a program that reads an .asg file and outputs a "setup" section.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: