Skip to content

Instantly share code, notes, and snippets.

@nennneko5787
Last active February 1, 2026 04:19
Show Gist options
  • Select an option

  • Save nennneko5787/82f9c20a2e6ee7bf42823df1d8551cfc to your computer and use it in GitHub Desktop.

Select an option

Save nennneko5787/82f9c20a2e6ee7bf42823df1d8551cfc to your computer and use it in GitHub Desktop.
某ゲーム
def getEventCodeByUserIndex(i: int):
converted = i * 3 + 3054
return (
str(converted)
.replace("0", "A")
.replace("1", "R")
.replace("2", "V")
.replace("3", "O")
.replace("4", "W")
.replace("5", "K")
.replace("6", "H")
.replace("7", "Z")
.replace("8", "M")
.replace("9", "X")
)
def getUserIndexByEventCode(ec: str):
converted = int(
str(ec)
.replace("A", "0")
.replace("R", "1")
.replace("V", "2")
.replace("O", "3")
.replace("W", "4")
.replace("K", "5")
.replace("H", "6")
.replace("Z", "7")
.replace("M", "8")
.replace("X", "9")
)
return (converted - 3054) // 3
print(getEventCodeByUserIndex(1))
print(getUserIndexByEventCode("ARVOWKH"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment