Code 1: Automation

Since pure drag-and-drop games can at times be a bit tedious for the players, it is often desirable to override one or more event handlers with custom Treescript code. Here is a partial list of features that can be accomplished this way. Features that are relatively difficult to implement are in italics.

 

Scramble

·      Fill rack

·      Display no. of letters left

·      Add score to total

·      Prevent moving letters already down

·      Calculate score

·      Click, not drag

 

Bridge

·      Deal hand

·      Move hand to dummy

·      Calculate winner of trick

·      Calculate who is declarer

·      Calculate who is dealer

·      Count NS/WE tricks

·      Add score to total

·      Calculate score

 

Backgammon

·      Roll dice

·      Click, not drag

·      Detect gammon/backgammon

·      Keep score