From 6e5eb2b2c55b40abc35d75341cb26ff2380979c1 Mon Sep 17 00:00:00 2001 From: foo Date: Mon, 15 Feb 2016 20:39:49 +0000 Subject: [PATCH] allow dictionary picking --- war/index.jsp | 23 +++++++++++++++++++++-- war/solver.jsp | 24 +++++++++++++++++++----- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/war/index.jsp b/war/index.jsp index 8888e61..8359769 100644 --- a/war/index.jsp +++ b/war/index.jsp @@ -1,12 +1,31 @@ Wordbubbles solver <%@ page import="uk.org.mafoo.wordbubbles.*" %> +<%@ page import="java.io.File" %> +<%@ page import="java.util.*" %>

Wordbubbles or Boggle solver

Input grid

- twl06
- +<% + File directory = new File(application.getRealPath("WEB-INF/dicts")); + File[] fList = directory.listFiles(); + boolean first = true; + List filelist = new ArrayList(); + for (File file : fList) { + if(file.getName().matches("^[a-z\\-_]+$")) { + filelist.add(file.getName()); + } + } + Collections.sort(filelist); + for(String file : filelist) { +%> + checked<%}%>><%= file %> +<% + first = false; + } +%> +