Skip to content

Commit

Permalink
changed style
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashesh Shroff committed Jan 26, 2022
1 parent 17672ad commit de6967e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
13 changes: 8 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,19 @@ def wordle():

# Exit if input is contradictory or too long
common_letters = list(set(avoid) & set(use))
no_error = True
messages = []
if (len(common_letters) > 0 ):
messages = [f"You are asking me to find words with letters to be used AND avoided: {', '.join(common_letters)}. Retry"]
return render_template('index.html', headers=messages, results="લાલ્લૂ માસ્ટર")
messages.append(f"You are asking me to find words with letters to be used AND avoided: {', '.join(common_letters)}. Retry")
no_error = False
if (len(use) > 5):
messages = [f"The number of letters that must be used cannot be greater than 5. Retry"]
messages.append(f"The number of letters that must be used cannot be greater than 5. Retry")
no_error = False
if (not no_error):
return render_template('index.html', headers=messages, results="લાલ્લૂ માસ્ટર")

# Find all words in list p that include all the letters in pattern in any order
results = p.copy()
messages = []
messages.append(f"Started with {len(results)} words")
for c in set(use):
results = [x for x in results if re.search("(?=.*" + c + ").*", x)]
Expand All @@ -66,4 +69,4 @@ def wordle():

if __name__ == '__main__':
server_port = os.environ.get('PORT', '8080')
app.run(debug=False, port=server_port, host='0.0.0.0')
app.run(debug=False, port=server_port, host='0.0.0.0')
8 changes: 4 additions & 4 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ em {
}

.hero .message {
font-size: 15px;
font-size: 20px;
text-align: center;
margin-bottom: 24px;
}

.hero .output {
font-size: 15px;
font-size: 20px;
text-align: center;
margin-bottom: 12px;
}
Expand All @@ -70,7 +70,7 @@ em {
}

.hero .callout {
font-size: 14px;
font-size: 20px;
color: #1967D2;
font-weight: 600;
padding: 16px 24px 16px 40px;
Expand Down Expand Up @@ -146,4 +146,4 @@ code {
display: block;
margin-bottom: 0em;
margin-top: 0em;
}
}
32 changes: 16 additions & 16 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Congratulations | Cloud Run</title>
<title>Wordle Solver</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="preload" as="font">
<link href="/static/cloud-run-32-color.png" rel="icon" type="image/png" />
<link href="/static/style.css" rel="stylesheet" type="text/css" />
Expand Down Expand Up @@ -31,18 +31,18 @@ <h2>Congratulations, you are about to master Wordle</h2>
</form>
</div>
<br>
<div class='callout' style="text-align:center">
{% if results %} {{ results }} {% endif %}
</div>
<div class='message' style="text-align:center">
{% if headers %}
<ul>
{% for line in headers %}
<br>{{ line }}</br>
{% endfor %}
</ul>
<br>
{% endif %}
</div>

</div>
{% if results %}
<div class='callout' style="text-align:center">
{{ results }}
</div>
{% endif %}
{% if headers %}
<div class='message' style="text-align:center">
<ul>
{% for line in headers %}
<br>{{ line }}</br>
{% endfor %}
</ul>
</div>
{% endif %}
</div>

0 comments on commit de6967e

Please sign in to comment.