FIXME: my new application.
Scramblies challenge
Complete the function (scramble? str1 str2) that returns true if a portion of str1 characters can be rearranged to match str2, otherwise returns false.
Notes:
- Only lower case letters will be used (a-z). No punctuation or digits will be included.
- Performance needs to be considered.
Examples:
(scramble? "rekqodlw" "world") ==> true
(scramble? "cedewaraaossoqqyt" "codewars") ==> true
(scramble? "katas" "steak") ==> false
Add a CLI so the program can be invoked from the commandline.
Create a web service that accepts two strings in a request and applies function scramble? from previous task to them.
Create a UI in ClojureScript with two inputs for strings and a scramble button. When the button is fired it should call the API from previous task and display a result. Notes
Please pay attention to tests, code readability and error cases.
Download from https://github.com/allentiak/FIXME
FIXME: explanation
Run the project directly, via :main-opts
(-m allentiak.scramble
):
$ clojure -M:run-m
Hello, World!
Run the project, overriding the name to be greeted:
$ clojure -M:run-m Via-Main
Hello, Via-Main!
Run the project's tests (they'll fail until you edit them):
$ clojure -T:build test
Run the project's CI pipeline and build an uberjar (this will fail until you edit the tests to pass):
$ clojure -T:build ci
This will produce an updated pom.xml
file with synchronized dependencies inside the META-INF
directory inside target/classes
and the uberjar in target
. You can update the version (and SCM tag)
information in generated pom.xml
by updating build.clj
.
If you don't want the pom.xml
file in your project, you can remove it. The ci
task will
still generate a minimal pom.xml
as part of the uber
task, unless you remove version
from build.clj
.
Run that uberjar:
$ java -jar target/net.clojars.allentiak/scramble-0.1.0-SNAPSHOT.jar
FIXME: listing of options this app accepts.
...
...
Copyright © 2023 Leandro Doctors
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.
If you modify this Program, or any covered work, by linking or combining it with Clojure (or a modified version of that library), containing parts covered by the terms of the Eclipse Public License (EPL), the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of Clojure used as well as that of the covered work.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.