<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<% Call head()
Call cardgame("剪刀石头布",yanse10)


dim num,msg,playerChoice
num=request("num")
playerChoice= Cstr(request("playerSelect"))
  set objgbrs=Server.CreateObject("ADODB.Recordset")
  conn.CommandTimeOut =999
  ssql="select * from users where id="&myid&""
  objgbrs.open ssql,conn
if num<>"" then
   num=Clng(num)
   if num>Clng(objgbrs("myjb")) or Clng(objgbrs("myjb")) < 500 then
      msg="呵呵,"&getcent&"不够就要那么豪赌嘛!"
      response.write msg & "<br/><a href='jiandao.asp?sid="&sid&"&amp;saytk="&saytk&"'>再来一次</a><br/>--------<br/><a href='../index.asp?sid="&sid&"'>社区首页</a>"
call head1()
	conn.close
	set objgbrs=nothing
	Set conn = Nothing
	response.end
   end if
   if num<500 then
      msg="最低投注额为5"&getcent&"!"
      response.write msg & "<br/><a href='jiandao.asp?sid="&sid&"&amp;saytk="&saytk&"'>再来一次</a><br/>--------<br/><a href='../index.asp?sid="&sid&"'>网站首页</a>"
call head1()
	conn.close
	set objgbrs=nothing
	Set conn = Nothing
	response.end
   end if
   if num>100000 then
      msg="赌博无益，少下点吧"
      response.write msg & "<br/><a href='jiandao.asp?sid="&sid&"&amp;saytk="&saytk&"'>&#20877;&#26469;&#19968;&#27425;</a><br/>--------<br/><a href='../index.asp?sid="&sid&"'>&#31038;&#21306;&#39318;&#39029;</a>"
call head1()
	conn.close
	set objgbrs=nothing
	Set conn = Nothing
	response.end
   end if
  else
    msg="乖乖,哪有无本生利的好事!"
      response.write msg & "<br/><a href='jiandao.asp?sid="&sid&"&amp;saytk="&saytk&"'>&#20877;&#26469;&#19968;&#27425;</a><br/>--------<br/><a href='../index.asp?sid="&sid&"'>&#31038;&#21306;&#39318;&#39029;</a>"
call head1()
	conn.close
	set objgbrs=nothing
	Set conn = Nothing
	response.end
  end if

    dim Rock
    dim Scissor
    dim Paper 
    Rock = "R"
    Scissor = "S"
    Paper = "P"
 computerChooses=computerChoosess
	If playerChoice = computerChooses Then
    msg="&#20320;&#20204;&#20457;&#30495;&#26159;&#24515;&#26377;&#28789;&#29312;&#65281;"
	End If

   If playerChoice=Rock and computerChooses = Scissor Then
 computerChooses=computerChoosess
   If playerChoice=Rock and computerChooses = Scissor Then
    sql="update users set myjb=myjb+" & num-num*0.1 & " where id="&myid&""
    conn.Execute(sql)
    msg="&#20320;&#30340;&#30707;&#22836;&#25462;&#25153;&#20102;&#26426;&#22120;&#20154;&#30340;&#21098;&#23376;&#65281;&#24744;&#24471;&#21040;" & num & "金币"
      else
    sql="update users set myjb=myjb-" & num & " where id="&myid&""
    conn.Execute(sql)
    msg="&#26426;&#22120;&#20154;&#30340;&#24067;&#21253;&#20303;&#20102;&#20320;&#30340;&#30707;&#22836;&#65281;&#24744;&#25439;&#22833;" & num & "金币"
		End If
		End If

   If playerChoice=Rock and computerChooses = Paper Then
    sql="update users set myjb=myjb-" & num & " where id="&myid&""
    conn.Execute(sql)
    msg="&#26426;&#22120;&#20154;&#30340;&#24067;&#21253;&#20303;&#20102;&#20320;&#30340;&#30707;&#22836;&#65281;&#24744;&#25439;&#22833;" & num & "金币"
		End If

    If playerChoice = Scissor and computerChooses = Paper Then
 computerChooses=computerChoosess
    If playerChoice = Scissor and computerChooses = Paper Then
    sql="update users set myjb=myjb+" & num-num*0.1 & " where id="&myid&""
    conn.Execute(sql)
    msg="&#20320;&#30340;&#21098;&#23376;&#21098;&#30772;&#20102;&#26426;&#22120;&#20154;&#30340;&#24067;&#65281;&#24744;&#24471;&#21040;" & num & "金币"
    bz="+"
      else
    sql="update users set myjb=myjb-" & num & " where id="&myid&""
    conn.Execute(sql)
    msg="&#26426;&#22120;&#20154;&#30340;&#30707;&#22836;&#25462;&#25153;&#20102;&#20320;&#30340;&#21098;&#23376;&#65281;&#24744;&#25439;&#22833;" & num & "金币"
		End If
		End If

    If playerChoice = Scissor and computerChooses = Rock Then
    sql="update users set myjb=myjb-" & num & " where id="&myid&""
    conn.Execute(sql)
    msg="&#26426;&#22120;&#20154;&#30340;&#30707;&#22836;&#25462;&#25153;&#20102;&#20320;&#30340;&#21098;&#23376;&#65281;&#24744;&#25439;&#22833;" & num & "金币"
		End If

	If playerChoice = Paper and computerChooses = Rock Then
 computerChooses=computerChoosess
	If playerChoice = Paper and computerChooses = Rock Then
    sql="update users set myjb=myjb+" & num-num*0.1 & " where id="&myid&""
    conn.Execute(sql)
    msg="&#20320;&#30340;&#24067;&#21253;&#20303;&#20102;&#26426;&#22120;&#20154;&#30340;&#30707;&#22836;&#65281;&#24744;&#24471;&#21040;" & num & "金币"
    bz="+"
      else
    sql="update users set myjb=myjb-" & num & " where id="&myid&""
    conn.Execute(sql)
    msg="&#26426;&#22120;&#20154;&#30340;&#21098;&#23376;&#21098;&#30772;&#20102;&#20320;&#30340;&#24067;&#65281;&#24744;&#25439;&#22833;" & num & "金币"
		End If
		End If

	If playerChoice = Paper and computerChooses = Scissor Then
    sql="update users set myjb=myjb-" & num & " where id="&myid&""
    conn.Execute(sql)
    msg="&#26426;&#22120;&#20154;&#30340;&#21098;&#23376;&#21098;&#30772;&#20102;&#20320;&#30340;&#24067;&#65281;&#24744;&#25439;&#22833;" & num & "金币"
		End If

  response.write msg

	conn.close
	set objgbrs=nothing
	Set conn = Nothing
Function computerChoosess()
Dim randomNum
Dim choice
	randomize
	randomNum = int(rnd*15)+1
	If randomNum = 1 OR randomNum = 3 OR randomNum = 7 OR randomNum = 8 OR randomNum = 15 OR randomNum = 12 Then
		choice = "R"
	ElseIf randomNum = 2 OR randomNum = 6 OR randomNum = 11 OR randomNum = 13 Then
		choice = "S"
	Else 
		choice = "P"
	End If
computerChoosess = choice
End Function
%>
<br/><a href="jiandao.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">剪刀石头布</a><br/>--------
<br/><a href="index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">社区游戏</a>
<br/><a href="../bbs/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">社区首页</a>
<br/><a href="../index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>">网站首页</a>
<%call head1()%>


