0
点赞
收藏
分享

微信扫一扫

[AHK]石头剪刀布游戏

small_Sun 2023-04-24 阅读 61


;2016年12月20日23:12:37
;作者:Quant
;石头剪刀布游戏
Gui,Add,Text,,请点选你要出的
Gui, Add, Button, g石头, 石头
Gui, Add, Button, g剪刀, 剪刀
Gui, Add, Button, g布, 布
Gui,Show,w300 h200,欢迎来到石头剪刀布的游戏
return
石头:
剪刀:
布:
game(A_ThisLabel)
return

GuiClose:
GuiEscape:
ExitApp

game(u)
{
	list1:=["石头","剪刀","布"]
	win:=""
	computer:=randomChoice(list1)
	;~ InputBox,u,欢迎来到石头剪刀布的游戏,你可以出啦:
	
	str:=u . computer
	if (computer=u)
		MsgBox,,平手,您出的%u%`n电脑出的%computer%`n
	else if str in 布石头,石头剪刀,剪刀布
		MsgBox,,您赢了!,您出的%u%`n电脑出的%computer%`n
	else
		MsgBox,,您输了!,您出的%u%`n电脑出的%computer%`n
}

randomChoice(list1)
{
	Random,choice,1,3
	return  list1[choice]
}


[AHK]石头剪刀布游戏_Text


举报

相关推荐

0 条评论