BBO Discussion Forums: handviewer end postion and leads - BBO Discussion Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

handviewer end postion and leads

#1 User is offline   jeller 

  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 2022-November-10

Posted 2022-November-10, 06:48

Hi, I'm trying to incorporate the handviewer into my bridge lessons but running into some problems with end positions.
Just a hand, works fine, even the play sequence.
n=S2HK5DAQT84C97542&s=SKT8HJ72DJ6532CT3&w=SAQ97643HTDK9CKQJ&a=2dppp&&sn=Fred&b=23&d=n&v=b&p=sjsksas2sqd4s5s8

But now I want to jump to an end position with north to lead. But if I use this with the same auction and press play. I have to lead from east as north is declarer
n=SHK5DC5&s=SHJ7DC3&w=SHTDCQJ&e=SHAQDCA&sn=Fred&b=23&d=n&v=b&&a=2dppp

When looking in the handviewer documentation: "Sometimes there is a need to create a presentation whereby either the contract or the player on lead and the trump suit is specified, but it is not appropriate to display an auction. This can be accomplished by setting the first character of the a parameter to a minus sign (-) and using the next few characters as follows:"
- For end position diagrams, use the next two characters to specify the player on lead and the trump suit. For example: a=-sc will put South on lead with clubs as trump.


But when I use the minus sign to force the lead to north, the handviewer sort of crashes (no auction visible, no board number visible, no play button)
n=SHK5DC5&s=SHJ7DC3&w=SHTDCQJ&e=SHAQDCA&sn=Fred&b=23&d=n&v=b&&a=-nd

not using the minus sign and just a=nd will result in displaying all buttons again and even it looks north has to lead when pressing the play button you cannot select a card as there is no aution

I sort of can fix it with a non cool workaround to make west dealer and declarer so north has to lead when pressing play, but that messes up the auction.
n=SHK5DC5&s=SHJ7DC3&w=SHTDCQJ&e=SHAQDCA&sn=Fred&b=23&d=w&v=b&&a=2dppp


anyone with a better solution than my workaround?

thanks!
0

#2 User is offline   thorvald 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 368
  • Joined: 2012-September-05
  • Gender:Male
  • Location:Denmark

Posted 2022-November-10, 10:38

Interesting problem

To show the Button with "Play" there has to be an auction or a played card

So https://www.bridgeba...&d=n&v=b&&a=-nd

will not show the buttons as you have seen.

I found a trick to add the buttons in this situation by adding a played card, looking like this

https://www.bridgeba...v=b&&a=-nd&p=c2

Now the problem is that there is no declarer, so when pressing play it is not possible to select any card

We can use the a=- a more subtle way, by using a=-2dn but that would still place East as the one to lead

So using your nice little trick we can change it to

https://www.bridgeba...=b&&a=-2dw&p=c2

Now the auction is not displayed and only if you look in lower right corner you will see west as declarer - and that box is not correct anyway as the tricks are incorrect

Last trick is to hide the box with declarer and tricks, and the only way I have found it can be done is editing the page after it is shown (setting the box to hidden)
Thorvald Aagaard
Mobile : +45 22 99 55 25
http://www.netbridge.dk
http://www.thorvald.dk
0

#3 User is offline   jeller 

  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 2022-November-10

Posted 2022-November-10, 13:32

thx! It's at least an improvement to what I came up with.

I have now downloaded it to local drive and tweaked a bit in the javascript handviewer.js
search in function manageTricksDiv() for the line
tricksDiv.style.left = 0;
and insert the line below after the found line
tricksDiv.style.display = "none";
now the right corner box is 'gone'
1

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users