Game 01
Code Analysis
<%str = Request("str")
If not str = "" Then result = Replace(str,"a","aad") result = Replace(result,"i","in") result1 = Mid(result,2,2) result2 = Mid(result,4,6) result = result1 & result2 Response.write result If result = "admin" Then pw = "????????" End if End if%>Replace(str, "a", "aad"): Replaces every ‘a’ with ‘aad’.Replace(result, "i", "in"): Replaces every ‘i’ with ‘in’.Mid(result, 2, 2): Extracts 2 characters starting from the 2nd index.Mid(result, 4, 6): Extracts up to 6 characters starting from the 4th index.- The goal is to make the final concatenated
resultequal toadmin.
If we input ami:
a->aadi->in- Intermediate result:
aadmin result1=Mid("aadmin", 2, 2)=adresult2=Mid("aadmin", 4, 6)=minresult=ad+min=admin
ami