Fix Tetris 2P preview block synchronization issue
- Prevent duplicate piece shapes when generating next pieces - Enhanced randomTetromino() with excludeShape parameter - Update piece placement logic to avoid visual duplicates - Improve initial state generation for both players - Add P1 and P2 next piece previews in 2P mode
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import requests
|
||||
|
||||
query = "OpenAI GPT-5"
|
||||
url = "http://search.severijnse.eu/search"
|
||||
|
||||
params = {
|
||||
"q": query,
|
||||
"tbm": "web",
|
||||
"num": 5,
|
||||
"safe": "off",
|
||||
"format": "json"
|
||||
}
|
||||
|
||||
headers = {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
|
||||
}
|
||||
|
||||
response = requests.get(url, params=params, headers=headers)
|
||||
|
||||
if response.status_code == 200:
|
||||
try:
|
||||
data = response.json()
|
||||
if "results" in data:
|
||||
for result in data["results"]:
|
||||
print(result["title"], "-", result["url"])
|
||||
else:
|
||||
print("No results key in JSON. The instance may restrict API access.")
|
||||
except Exception as e:
|
||||
print("Error parsing JSON:", e)
|
||||
else:
|
||||
print("Request failed with status:", response.status_code)
|
||||
|
||||
Reference in New Issue
Block a user