아는 것이 좋은 것이다.

[ASP] 랜덤함수 본문

ASP

[ASP] 랜덤함수

start0 2014. 5. 23. 17:14


<%

'랜덤함수

'4지선다 답 맞추기. 답이 맞으면 포인트부여

 Randomize()

 answer = Int((Rnd * 4) + 1)               '최대 4, 최소 1

 Randomize()

 answer_value = Int((Rnd * 4) + 1)

 Dim Get_Point(4)

 Get_Point(1) = 500

 Get_Point(2) = 300

 Get_Point(3) = 200

 Get_Point(4) = 100

 If answer = answer_value Then

  Get_Point_Value = Get_Point(answer)

 Else 

  Get_Point_Value = Get_Point(4)

 End If

%>

<%=answer%><br>

< %=answer_value%><br>

< %=Get_Point_Value%><br>



Comments