mirror of
https://github.com/fooflington/wordsearch.git
synced 2025-01-22 09:19:55 +00:00
tweaks
This commit is contained in:
parent
c0192d96cf
commit
947dd5fcd9
@ -18,6 +18,7 @@
|
|||||||
int width = Integer.parseInt(request.getParameter("width"));
|
int width = Integer.parseInt(request.getParameter("width"));
|
||||||
|
|
||||||
if (request.getParameter("words").length() > 2048) { throw new Exception("Input too large"); }
|
if (request.getParameter("words").length() > 2048) { throw new Exception("Input too large"); }
|
||||||
|
if (height > 100 || width > 100) { throw new Exception("Dimentions too large"); }
|
||||||
|
|
||||||
List<String> words = new ArrayList<String>();
|
List<String> words = new ArrayList<String>();
|
||||||
for ( String line : request.getParameter("words").split("\r\n")) {
|
for ( String line : request.getParameter("words").split("\r\n")) {
|
||||||
@ -29,14 +30,17 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>Wordsearch builder</h1>
|
<h1>Wordsearch builder</h1>
|
||||||
<h2>Words</h2>
|
<h2>Words</h2>
|
||||||
<ul>
|
|
||||||
<% for (String word : words) { %>
|
<div style="float: right; padding: 15px;">
|
||||||
<li><%= word.trim() %></li>
|
<ul>
|
||||||
<% } %>
|
<% for (String word : words) { %>
|
||||||
</ul>
|
<li><%= word.trim() %></li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>Grid</h2>
|
<h2>Grid</h2>
|
||||||
<table style="font-family: monospace;">
|
<table style="font-family: monospace; font-size: 16;">
|
||||||
<% for(char[] row : grid) { %>
|
<% for(char[] row : grid) { %>
|
||||||
<tr>
|
<tr>
|
||||||
<% for(char c : row) { %>
|
<% for(char c : row) { %>
|
||||||
@ -45,8 +49,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% } %>
|
<% } %>
|
||||||
</table>
|
</table>
|
||||||
<footer>
|
|
||||||
Generated
|
|
||||||
</footer>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<h1>Wordsearch builder</h1>
|
<h1>Wordsearch builder</h1>
|
||||||
<h2>Words</h2>
|
<h2>Words</h2>
|
||||||
<form action="build.jsp">
|
<form action="build.jsp">
|
||||||
<textarea name="words" rows="10">
|
<textarea name="words" rows="10">
|
||||||
Kitchen
|
Kitchen
|
||||||
Lounge
|
Lounge
|
||||||
Study
|
Study
|
||||||
@ -14,7 +14,7 @@ Billiard Room
|
|||||||
Library
|
Library
|
||||||
Hall
|
Hall
|
||||||
Dining Room
|
Dining Room
|
||||||
</textarea>
|
</textarea>
|
||||||
<br />
|
<br />
|
||||||
<input type="number" name="height" min="3" max="50" value="15" />
|
<input type="number" name="height" min="3" max="50" value="15" />
|
||||||
<input type="number" name="width" min="3" max="50" value="15" />
|
<input type="number" name="width" min="3" max="50" value="15" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user