The coding test :"First Round - Coding Test: The coding test is designed to assess your…
- User
The coding test :"First Round - Coding Test: The coding test is designed to assess your programming skills and problem-solving abilities. You will have around one week, until May 30th, to complete the test. 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'" Help me to write this Python code. Explain it to me step by step because I am a beginner.
- Assistant
- User
How to save the above code in a file, say wordle_guesser.py, and run it using:
python wordle_guesser.py
- Assistant
Sure, I can guide you through the process of saving the Python code to a file and running it.
Step 1: Save the Code to a File
- User
The output:"Guess: apple, Result: [{'slot': 0, 'guess': 'a', 'result': 'absent'}, {'slot': 1, 'guess': 'p', 'result': 'absent'}, {'slot': 2, 'guess': 'p', 'result': 'absent'}, {'slot': 3, 'guess': 'l', 'result': 'correct'}, {'slot': 4, 'guess': 'e', 'result': 'absent'}] Guess: house, Result: [{'slot': 0, 'guess': 'h', 'result': 'absent'}, {'slot': 1, 'guess': 'o', 'result': 'present'}, {'slot': 2, 'guess': 'u', 'result': 'absent'}, {'slot': 3, 'guess': 's', 'result': 'present'}, {'slot': 4, 'guess': 'e', 'result': 'absent'}] Guess: table, Result: [{'slot': 0, 'guess': 't', 'result': 'absent'}, {'slot': 1, 'guess': 'a', 'result': 'absent'}, {'slot': 2, 'guess': 'b', 'result': 'absent'}, {'slot': 3, 'guess': 'l', 'result': 'correct'}, {'slot': 4, 'guess': 'e', 'result': 'absent'}] Guess: theft, Result: [{'slot': 0, 'guess': 't', 'result': 'absent'}, {'slot': 1, 'guess': 'h', 'result': 'absent'}, {'slot': 2, 'guess': 'e', 'result': 'absent'}, {'slot': 3, 'guess': 'f', 'result': 'absent'}, {'slot': 4, 'guess': 't', 'result': 'absent'}] Guess: truck, Result: [{'slot': 0, 'guess': 't', 'result': 'absent'}, {'slot': 1, 'guess': 'r', 'result': 'absent'}, {'slot': 2, 'guess': 'u', 'result': 'absent'}, {'slot': 3, 'guess': 'c', 'result': 'present'}, {'slot': 4, 'guess': 'k', 'result': 'absent'}] " Is it correct?
- Assistant
- User
Can you write an advanced algorithm to guest the word?
- Assistant
- User
Use more sophisticated elimination techniques
- Assistant