diff --git a/.fleet/settings.json b/.fleet/settings.json deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore index 1aa1ac1..6ee3481 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,4 @@ maze/__pycache__ maze/modules/__pycache__ saves tetris -wordle-curses/__pycache__ -1.json -2.json -3.json \ No newline at end of file +wordle-curses/__pycache__ \ No newline at end of file diff --git a/dbdump.sql b/dbdump.sql index b0feac5..0c41858 100644 --- a/dbdump.sql +++ b/dbdump.sql @@ -64,7 +64,7 @@ CREATE TABLE `player_details` ( LOCK TABLES `player_details` WRITE; /*!40000 ALTER TABLE `player_details` DISABLE KEYS */; -INSERT INTO `player_details` VALUES ('2BC4','DEF_456','def@gmail.com','RkVEXzY1NA=='),('4DE6','JKL_100','mb11859@boysmgp.onmicrosoft.com','TEtKXzAwMQ=='),('QU60','ABC_123','testuser1@gmail.com','Q2JhXzMyMQ=='); +INSERT INTO `player_details` VALUES ('2BC4','DEF_456','def@gmail.com','RkVEXzY1NA=='),('QU60','ABC_123','testuser1@gmail.com','Q2JhXzMyMQ=='); /*!40000 ALTER TABLE `player_details` ENABLE KEYS */; UNLOCK TABLES; diff --git a/helper_scripts/dumpsample.bat b/helper_scripts/dumpsample.bat deleted file mode 100644 index e69de29..0000000 diff --git a/helper_scripts/initsql.bat b/helper_scripts/initsql.bat deleted file mode 100644 index e69de29..0000000 diff --git a/helper_scripts/play.bat b/helper_scripts/play.bat deleted file mode 100644 index 9cddf3f..0000000 --- a/helper_scripts/play.bat +++ /dev/null @@ -1 +0,0 @@ -start python %~f1/starter.py \ No newline at end of file diff --git a/play.bat b/play.bat deleted file mode 100644 index 85f4f6d..0000000 --- a/play.bat +++ /dev/null @@ -1,37 +0,0 @@ -:: Play the game -@ECHO off -cls -:start -ECHO. -ECHO 1. Play game -ECHO 2. Initialise SQL login creds -ECHO 3. Dump sample data -ECHO 4. Exit -set choice= -set /p choice=Choice? -if not '%choice%'=='' set choice=%choice:~0,1% -if '%choice%'=='1' goto play -if '%choice%'=='2' goto initsql -if '%choice%'=='3' goto dump -if '%choice%'=='4' goto end -ECHO "%choice%" is not valid, try again -ECHO. -goto start - -:play -start cmd /c "python %~dp0%~1/starter.py" -move nul 2>&0 -goto end - -:initsql -start cmd /c "python %~dp0%~1/starter.py initsql" -move nul 2>&0 -goto end - -:dump -start cmd /c "python %~dp0%~1/starter.py dumpsample" -move nul 2>&0 -goto end - -:end -pause \ No newline at end of file diff --git a/play.vbs b/play.vbs deleted file mode 100644 index 1bc4241..0000000 --- a/play.vbs +++ /dev/null @@ -1,39 +0,0 @@ -strTitle = "Labyrinth" -strMsg = "1. Play" & vbCr -strMsg = strMsg & "2. Initialise SQL creds" & vbCR -strMsg = strMsg & "3. Dump sample data" & vbCR -strMsg = strMsg & "Select choice:" & vbCR -Dim oShell -Set oShell = WScript.CreateObject ("WScript.Shell") -Dim folderName -folderName = "." -Dim fso -Set fso = CreateObject("Scripting.FileSystemObject") -Dim fullpath -fullpath = fso.GetAbsolutePathName(folderName) -const quote = """" -Dim command -Do - inp01 = InputBox(strMsg,strTitle) - OK = True - Select Case inp01 - Case "1" - command = quote + "C:\Program Files\PowerShell\7\pwsh.exe" & quote & "-ExecutionPolicy ByPass -NoExit -Command & " & quote & "E:\Programs\Miniconda3\shell\condabin\conda-hook.ps1" & quote & "; conda activate " & quote & "E:\Programs\Miniconda3" & quote & "; conda activate adi; python " & fullpath & "\starter.py" - command = "cmd.exe /C python "+fullpath+"\starter.py" - msgBox command - oShell.run ""+command - Case "2" - command = quote + "C:\Program Files\PowerShell\7\pwsh.exe" & quote & "-ExecutionPolicy ByPass -NoExit -Command & " & quote & "E:\Programs\Miniconda3\shell\condabin\conda-hook.ps1" & quote & "; conda activate " & quote & "E:\Programs\Miniconda3" & quote & "; conda activate adi; python " & fullpath & "\starter.py initsql" - command = "cmd.exe /C python "+fullpath+"\starter.py initsql" - oShell.run ""+command - Case "3" - command = quote + "C:\Program Files\PowerShell\7\pwsh.exe" & quote & "-ExecutionPolicy ByPass -NoExit -Command & " & quote & "E:\Programs\Miniconda3\shell\condabin\conda-hook.ps1" & quote & "; conda activate " & quote & "E:\Programs\Miniconda3" & quote & "; conda activate adi; python " & fullpath & "\starter.py dumpsample" - command = "cmd.exe /C python "+fullpath+"\starter.py dumpsample" - oShell.run ""+command - Case "" - WScript.quit - Case Else - MsgBox "You made an incorrect selection!",64,strTitle - OK = False - End Select -Loop While Not OK diff --git a/wordle/dictionary.py b/wordle/dictionary.py index f67fc61..32176fa 100644 --- a/wordle/dictionary.py +++ b/wordle/dictionary.py @@ -1,5 +1,6 @@ -import pickle import json +import pickle + import requests with open("credentials.pickle", "rb") as f: @@ -18,7 +19,6 @@ language = "en-us" def defnsyn(w): """Returns definition and synonym of said word""" - f = open("log.txt", "a") url = ( r"https://od-api.oxforddictionaries.com:443/api/v2/entries/" + language @@ -27,10 +27,8 @@ def defnsyn(w): ) r = requests.get(url, headers={"app_id": app_id, "app_key": app_key}) if r.status_code != 200: - f.write("GOT "+str(r.status_code)) return None, None res = r.json() - f.write(json.dumps(res)) s1 = res["results"][0]["lexicalEntries"] lexicalCategories = [] synonyms = [] diff --git a/wordle/wordle.py b/wordle/wordle.py index 3991ac0..990134b 100644 --- a/wordle/wordle.py +++ b/wordle/wordle.py @@ -4,6 +4,7 @@ import time import maze.menu import maze.modules.maze as m1 + from wordle.dictionary import defnsyn quitwordle = False @@ -19,6 +20,7 @@ completionMessages = [ "Good!", ] + # Draw one row of the board # Generates new row + colours alphabets in def writeWord(s, word, remark, y): @@ -109,8 +111,6 @@ def getWord(s, y): def run(s): s.clear() word = random.choice(words) # chosen word - with open("log.txt", "a") as f: - f.write("Chosen word: " + word + "\n") defn, synonyms = defnsyn(word) guesses = [] # stores each guess and its result alphabet = ["u"] * 26 # current status of each letter whether used or not