mirror of
https://github.com/fooflington/wordbubbles.git
synced 2025-07-03 23:19:07 +00:00
allow dictionary picking
This commit is contained in:
@ -1,12 +1,31 @@
|
||||
<html>
|
||||
<head><title>Wordbubbles solver</title></head>
|
||||
<%@ page import="uk.org.mafoo.wordbubbles.*" %>
|
||||
<%@ page import="java.io.File" %>
|
||||
<%@ page import="java.util.*" %>
|
||||
<body>
|
||||
<h1>Wordbubbles or Boggle solver</h1>
|
||||
<h2>Input grid</h2>
|
||||
<form action="solver.jsp">
|
||||
<input type="radio" name="dictionary" checked>twl06</input><br />
|
||||
|
||||
<%
|
||||
File directory = new File(application.getRealPath("WEB-INF/dicts"));
|
||||
File[] fList = directory.listFiles();
|
||||
boolean first = true;
|
||||
List<String> filelist = new ArrayList<String>();
|
||||
for (File file : fList) {
|
||||
if(file.getName().matches("^[a-z\\-_]+$")) {
|
||||
filelist.add(file.getName());
|
||||
}
|
||||
}
|
||||
Collections.sort(filelist);
|
||||
for(String file : filelist) {
|
||||
%>
|
||||
<input type="radio" name="dict" value="<%= file %>" <% if(first) { %>checked<%}%>><%= file %></input>
|
||||
<%
|
||||
first = false;
|
||||
}
|
||||
%>
|
||||
<br />
|
||||
<textarea name="grid" rows="10" cols="10" style="font-family: monospace;">
|
||||
som e
|
||||
te xt
|
||||
|
Reference in New Issue
Block a user