Removal of unecessary helper scripts and log files.

Removal of log files in wordle.
This commit is contained in:
adithyagenie 2023-08-17 17:51:45 +05:30
parent 7fb7b5b69b
commit fe072c82eb
10 changed files with 6 additions and 88 deletions

View file

3
.gitignore vendored
View file

@ -7,6 +7,3 @@ maze/modules/__pycache__
saves
tetris
wordle-curses/__pycache__
1.json
2.json
3.json

View file

@ -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;

View file

@ -1 +0,0 @@
start python %~f1/starter.py

View file

@ -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

View file

@ -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

View file

@ -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 = []

View file

@ -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