Here is my crude solution to my poker position problem.

NB. create table with 10 positions
table =: i. 10

dealerPosition =: 3

dealerOrder =: (button +1) |. table

NB. hard code that I am seated at seat 7
mySeat =: 7

NB. specify what seats have no players
emptySeats =: 2 3 8

NB. remove non-playing players
players =: dealerOrder -. emptySeats

NB. index of my position at table
my_index =: players i. mySeat

NB. determine relative position to dealer
positionRelativeToDealer =: (my_index+1) - (#players)


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to