抽獎源碼下載
⑴ 誰能幫我做一個數字滾動,點擊停,就停在一個數字上,抽獎用的,謝謝哦。
;AutoIt自動化腳本源代碼
#include<ButtonConstants.au3>
#include<EditConstants.au3>
#include<GUIConstantsEx.au3>
#include<WindowsConstants.au3>
Opt("GUIOnEventMode",1)
Global$flag=False
#Region###STARTKodaGUIsection###Form=
Global$Form1=GUICreate("抽獎抽出號碼1~100",623,449,192,114)
GUISetOnEvent($GUI_EVENT_CLOSE,"Form1Close")
Global$Input1=GUICtrlCreateInput("",56,72,161,25,$ES_READONLY)
Global$Button1=GUICtrlCreateButton("開始",264,72,65,25)
GUICtrlSetOnEvent(-1,"Button1Click")
GUISetState(@SW_SHOW)
#EndRegion###ENDKodaGUIsection###While1
Sleep(100)
If$flagThen
GUICtrlSetData($Input1,Random(1,100,1))
EndIf
WEndFuncButton1Click()
IfNot$flagThen
GUICtrlSetData($Button1,"停止")
$flag=True
Else
GUICtrlSetData($Button1,"開始")
$flag=False
EndIf
EndFunc
FuncForm1Close()
Exit
EndFunc效果圖
35選7彩票程序
public class caipiao
{
static void generate()
{
int a[]=new int[7];
int i,m,j;
fan:for(j=0;j <7;j++){//外循環實現隨機生成每組7個數
a[j]=(int)(Math.random()*35+1);
m=a[j];
if(j>=1){
for(i=0;i <j;i++)//內循環實現無重復
if(a[i]==m){
j--;
continue fan;
}
}
if(a[j] <10)
System.out.print("0"+a[j]+" ");
else
System.out.print(a[j]+" ");
}
}
public static void main (String args[]){
int n=Integer.parseInt(args[0]);
System.out.println("中國福利彩票35選7");
for(int i=0;i <n;i++){//循環調用方法實現輸出n組數
generate();
System.out.println();
}
}
}
⑶ 入門級九宮格H5抽獎實現(可直接在手機上運行)附源碼
打造一個能輕松運行於手機與電腦的九宮格H5抽獎頁面,不僅能夠作為犯錯後的貼心懲罰,亦可作為各類活動的有趣抽獎工具,只需根據個人需求調整選項內容即可。
只需在手機瀏覽器中輸入鏈接即可體驗,無需特別操作,點擊頁面中央深色的抽獎按鈕,即可觸發抽獎過程,待抽獎結束,中獎結果便會以彈窗形式呈現。
在手機設備上,以微信或網路APP為例,只需打開瀏覽器,輸入相應鏈接地址即可開始體驗。
對於具體實現代碼,參考HTML實現轉盤抽獎的簡單通用模板,在CSDN博客中可以找到詳細的教程與示例代碼,便於快速上手。