The instructions for the coding test are as follows:" Votee would like to conduct the…
- User
The instructions for the coding test are as follows:"
Votee would like to conduct the coding test in a recorded live session. The idea is to connect to an API that plays a Wordle-like puzzle. You can find the API documentation at the following link: https://wordle.votee.dev:8000/redoc
Developers are allowed to use any frameworks, IDEs, chatbots, LLMs, or other resources to write their program and showcase their skill set. However, if you take references from other open-source projects or tutorials, please ensure that proper credit is given. Plagiarism will not be tolerated, and it may affect the evaluation of your application.
Your task is to write a program that automatically guesses random words against the API, using the following command as an example: curl -v ‘https://wordle.votee.dev:8000/random?guess=theft&seed=1234'" If I run curl -v ‘https://wordle.votee.dev:8000/random?guess=theft&seed=1234 in the terminal, the output: StatusCode : 200 StatusDescription : OK Content : [{"slot":0,"guess":"t","result":"correct"},{"slot":1,"guess":"h","result":"correct"},{"slot":2,"guess":"e","result":"correct"}, {"slot":3,"guess":"f","result":"correct"},{"slot":4,"guess":"t","result":... RawContent : HTTP/1.1 200 OK Content-Length: 211 Content-Type: application/json Date: Sun, 26 May 2024 08:27:33 GMT Server: uvicorn
code[{"slot":0,"guess":"t","result":"correct"},{"slot":1,"guess":"h","result":...Forms : {} Headers : {[Content-Length, 211], [Content-Type, application/json], [Date, Sun, 26 May 2024 08:27:33 GMT], [Server, uvicorn]} Images : {} InputFields : {} Links : {} ParsedHtml : mshtml.HTMLDocumentClass RawContentLength : 211
My Python program that guess the words: "import random import requests import json
Load the word list from a file.
with open("C:/Users/a/Desktop/wordle/valid-wordle-words.txt", 'r') as file: word_list = [line.strip() for line in file.readlines()]
API base URL
base_url = 'https://wordle.votee.dev:8000/random'
Function to make a guess by calling the API.
def make_guess(guess, seed): response = requests.get(f"{base_url}?guess={guess}&seed={seed}") if response.status_code == 200: # Check if the response status code is 200 (OK) return response.json() # Return the JSON response else: print("Failed to call the api.") return None # Return None if the request was not successful
- Assistant
- User
Your code have error:"Traceback (most recent call last): File "C:\Users\a\Desktop\python\pythonProject1\main.py", line 137, in test_multiple_seeds() File "C:\Users\a\Desktop\python\pythonProject1\main.py", line 130, in test_multiple_seeds mean_case = sum(attempts_list) / len(attempts_list) ^^^^^^^^^^^^^^^^^^ TypeError: unsupported operand type(s) for +: 'int' and 'str'"
- Assistant
- User
Just modify the test_multiple_seeds function
- Assistant
- User
Your code's calculation is wrong because I printed some output:"Testing with seed 6 Words remaining in the list: 14855 Attempt 1: Guessing 'aahed'... Feedback: [{'slot': 0, 'guess': 'a', 'result': 'absent'}, {'slot': 1, 'guess': 'a', 'result': 'absent'}, {'slot': 2, 'guess': 'h', 'result': 'absent'}, {'slot': 3, 'guess': 'e', 'result': 'present'}, {'slot': 4, 'guess': 'd', 'result': 'absent'}] Words remaining in the list: 1879 Attempt 2: Guessing 'bebop'... Feedback: [{'slot': 0, 'guess': 'b', 'result': 'present'}, {'slot': 1, 'guess': 'e', 'result': 'present'}, {'slot': 2, 'guess': 'b', 'result': 'present'}, {'slot': 3, 'guess': 'o', 'result': 'absent'}, {'slot': 4, 'guess': 'p', 'result': 'absent'}] Words remaining in the list: 10 Attempt 3: Guessing 'ebene'... Feedback: [{'slot': 0, 'guess': 'e', 'result': 'present'}, {'slot': 1, 'guess': 'b', 'result': 'present'}, {'slot': 2, 'guess': 'e', 'result': 'present'}, {'slot': 3, 'guess': 'n', 'result': 'absent'}, {'slot': 4, 'guess': 'e', 'result': 'correct'}] Words remaining in the list: 1 Attempt 4: Guessing 'tribe'... Feedback: [{'slot': 0, 'guess': 't', 'result': 'correct'}, {'slot': 1, 'guess': 'r', 'result': 'correct'}, {'slot': 2, 'guess': 'i', 'result': 'correct'}, {'slot': 3, 'guess': 'b', 'result': 'correct'}, {'slot': 4, 'guess': 'e', 'result': 'correct'}] Solved with guess: tribe Unexpected return value 'tribe' for seed 6. Using max attempts (6)."
- Assistant
- User
Wrong ,solve_puzzle(seed) will return the guess
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.