% Option Explicit %> <% Const UPPER_CASE_ = 0 Const LOWER_CASE_ = 1 Sub Main Call WriteStandardHeader("Greek Alphabet (Ancient) - " & _ "A Guide for Mathematicians and Computer Scientists", "XXX", "XXX") If Request.QueryString("action") = "summary" Then Call ShowSummary() ElseIf Request.QueryString("action") = "test" Then Call ShowTest() ElseIf Request.QueryString("action") = "answer" Then Call ShowAnswer(CInt(Request.QueryString("code")), _ CInt(Request.QueryString("case"))) Else Call ShowIntro() End If Call ShowMenu() Call WriteStandardFooter() End Sub Sub ShowSummary() Dim arrLetters, intLetter arrLetters = GetLetters() %>
| Position | Name | Uppercase | Lowercase |
|---|---|---|---|
| " & intLetter & _ " | " & _ arrLetters(intLetter).LetterName & _ " | " & _ arrLetters(intLetter).UppercaseHTML & _ " | " & _ arrLetters(intLetter).LowercaseHTML & " |
" If intCase = UPPER_CASE_ Then Response.Write arrLetters(intLetter).UpperCaseHTML() Else Response.Write arrLetters(intLetter).LowerCaseHTML() End If Response.Write "
" & vbCrLf %>Guess which Greek letter this is and what case it is in.
<% End Sub Sub ShowAnswer(intCode, intCaseCode) Dim objLetter, strCase, intCase Set objLetter = GetLetter(Unobsfucate(intCode)) intCase = UnobsfucateCase(intCaseCode) If CInt(intCase) = CInt(UPPER_CASE_) Then strCase = "upper case" Else strCase = "lower case" End If %>The answer was <%= strCase & " " & objLetter.LetterName %>.
<% End Sub Sub ShowIntro() %>This section is a guide to ancient greek letters for mathematicians and computer scientists. Study the table found under "Summary" below and then test yourself by clicking on "Test Me!"
<% End Sub Sub ShowMenu() %> <% End Sub Function Obsfucate(intLetterNo) Obsfucate = ((intLetterNo * 3) + 8) * 2 End Function Function Unobsfucate(intCode) Unobsfucate = ((intCode / 2) - 8) / 3 End Function Function ObsfucateCase(intCase) Dim r, intCode Randomize Timer r = CInt(Rnd * 7) If intCase = UPPER_CASE_ And r = 0 Then intCode = 6 ElseIf intCase = UPPER_CASE_ And r = 1 Then intCode = 7 ElseIf intCase = UPPER_CASE_ And r = 2 Then intCode = 8 ElseIf intCase = UPPER_CASE_ And r = 3 Then intCode = 13 ElseIf intCase = UPPER_CASE_ And r = 4 Then intCode = 1 ElseIf intCase = UPPER_CASE_ And r = 5 Then intCode = 5 ElseIf intCase = UPPER_CASE_ And r = 6 Then intCode = 10 ElseIf intCase = UPPER_CASE_ And r = 7 Then intCode = 4 ElseIf intCase = LOWER_CASE_ And r = 0 Then intCode = 16 ElseIf intCase = LOWER_CASE_ And r = 1 Then intCode = 9 ElseIf intCase = LOWER_CASE_ And r = 2 Then intCode = 15 ElseIf intCase = LOWER_CASE_ And r = 3 Then intCode = 2 ElseIf intCase = LOWER_CASE_ And r = 4 Then intCode = 14 ElseIf intCase = LOWER_CASE_ And r = 5 Then intCode = 12 ElseIf intCase = LOWER_CASE_ And r = 6 Then intCode = 11 ElseIf intCase = LOWER_CASE_ And r = 7 Then intCode = 3 Else Response.Wirte "panic with r of " & r End If ObsfucateCase = intCode End Function Function UnobsfucateCase(intCode) Dim intCase If intCode = 1 Then intCase = UPPER_CASE_ ElseIf intCode = 2 Then intCase = LOWER_CASE_ ElseIf intCode = 3 Then intCase = LOWER_CASE_ ElseIf intCode = 4 Then intCase = UPPER_CASE_ ElseIf intCode = 5 Then intCase = UPPER_CASE_ ElseIf intCode = 6 Then intCase = UPPER_CASE_ ElseIf intCode = 7 Then intCase = UPPER_CASE_ ElseIf intCode = 8 Then intCase = UPPER_CASE_ ElseIf intCode = 9 Then intCase = LOWER_CASE_ ElseIf intCode = 10 Then intCase = UPPER_CASE_ ElseIf intCode = 11 Then intCase = LOWER_CASE_ ElseIf intCode = 12 Then intCase = LOWER_CASE_ ElseIf intCode = 13 Then intCase = UPPER_CASE_ ElseIf intCode = 14 Then intCase = LOWER_CASE_ ElseIf intCode = 15 Then intCase = LOWER_CASE_ ElseIf intCode = 16 Then intCase = LOWER_CASE_ Else Response.Write "broken" End If UnobsfucateCase = intCase End Function Call Main() %>