topical media & game development

talk show tell print

game-javascript-casual-bridge-game.htm / htm



  NE STEP TO INSTALL BRIDGE:
  
     1.  Add the code into the BODY of your HTML document  -->
  
  <!-- STEP ONE: Copy this code into the BODY of your HTML document  -->
  
  <SCRIPT LANGUAGE="JavaScript">
  
  <!-- Original:  Randy Bennett (randyben@avalon.nf.ca) -->
  <!-- Web Site:  http://home.thezone.net/~rbennett/utility/javahead.htm -->
  
  <!-- This script and many more are available free online at -->
  <!-- The JavaScript Source!! http://javascript.internet.com -->
  
  <!-- Begin
  n = new Array ("X","2","3","4","5","6","7","8","9","T","J","Q","K","A","2","3","4","5","6","7","8","9","T","J","Q","K","A","2","3","4","5","6","7","8","9","T","J","Q","K","A","2","3","4","5","6","7","8","9","T","J","Q","K","A")
  m = new Array (53)
  f = new Array("C ","D ","H ","S ")
  g = new Array(53)
  function gethand(){
  var a = 52
  while (a > 0){
  var b = 53
  var x = Math.random()
  x = new String (x)
  x = x.substring(x.length -5)
  x = Math.round(x*.52/1000)
  if (x == 0) x = 52
  if (m[x] == 100) a = a+1
  else if (m[x] != 100) g[a] = x
  m[x] = 100
  a = a -1
  }
  var t = 3;var s = 1;var h = 1;var d = 1;var c = 1;var b = 52;
  while (b > 0){
  if (t == 3) if (s == 1)document.write("<center><table><tr><td width=90></td><td width=90><font size=2><b>North</b><br>",f[3]);
  if (t == 3) s = 0;
  if (b < 40) t = 2;
  if (t == 2) if (h == 1)document.write("<br>",f[2]);
  if (t == 2) h = 0;
  if (b < 27) if (b > 13) t = 1;
  if (t == 1) if (d == 1)document.write("<br>",f[1]);
  if (t == 1) d = 0;
  if (b < 14)  t = 0;
  if (t == 0) if (c == 1)document.write("<br>",f[0]);
  if (t == 0) c = 0;
  var cc = 13
  while (cc > 0){
  if (g[cc] == b)document.write(n[b])
  cc = cc - 1
  }
  b = b - 1
  }
  var t = 3;var s = 1;var h = 1;var d = 1;var c = 1;var b = 52
  while (b > 0){
  if (t == 3) if (s == 1)document.write("</td><td width=90></td></tr><tr><td><font size=2><b>West</b><br>",f[3])
  if (t == 3) s = 0
  if (b < 40) t = 2
  if (t == 2) if (h == 1)document.write("<br>",f[2])
  if (t == 2) h = 0
  if (b < 27) if (b > 13) t = 1
  if (t == 1) if (d == 1)document.write("<br>",f[1])
  if (t == 1) d = 0
  if (b < 14)  t = 0
  if (t == 0) if (c == 1)document.write("<br>",f[0])
  if (t == 0) c = 0
  var cc = 26
  while (cc > 13){
  if (g[cc] == b)document.write(n[b])
  cc = cc - 1
  }
  b = b - 1
  }
  var t = 3;var s = 1;var h = 1;var d = 1;var c = 1;var b = 52
  while (b > 0){
  if (t == 3) if (s == 1)document.write("</td><td></td><td><font size=2><b>East</b><br>",f[3])
  if (t == 3) s = 0
  if (b < 40) t = 2
  if (t == 2) if (h == 1)document.write("<br>",f[2])
  if (t == 2) h = 0
  if (b < 27) if (b > 13) t = 1
  if (t == 1) if (d == 1)document.write("<br>",f[1])
  if (t == 1) d = 0
  if (b < 14)  t = 0
  if (t == 0) if (c == 1)document.write("<br>",f[0])
  if (t == 0) c = 0
  var cc = 39
  while (cc > 26){
  if (g[cc] == b)document.write(n[b])
  cc = cc - 1
  }
  b = b - 1
  }
  var t = 3;var s = 1;var h = 1;var d = 1;var c = 1;var b = 52
  while (b > 0){
  if (t == 3) if (s == 1)document.write("</td></tr><tr><td></td><td><font size=2><b>South</b><br>",f[3])
  if (t == 3) s = 0
  if (b < 40) t = 2
  if (t == 2) if (h == 1)document.write("<br>",f[2])
  if (t == 2) h = 0
  if (b < 27) if (b > 13) t = 1
  if (t == 1) if (d == 1)document.write("<br>",f[1])
  if (t == 1) d = 0
  if (b < 14)  t = 0
  if (t == 0) if (c == 1)document.write("<br>",f[0])
  if (t == 0) c = 0
  var cc = 52
  while (cc > 39){
  if (g[cc] == b)document.write(n[b])
  cc = cc - 1
  }
  b = b - 1
  }
  document.write("</td><td></td></tr></table></center>")
  }
  gethand();
  // End -->
  </script>
  
  <p><center>
  <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
  by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  </center><p>
  
  <!-- Script Size:  3.44 KB  -->
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.