summary refs log tree commit diff stats
path: root/clojure/hello-world
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-05 16:36:40 +0530
committerAndinus <andinus@nand.sh>2021-09-05 16:36:40 +0530
commit38b4e6fa229e65eae10f8a06c81ef1a0802d45f5 (patch)
treecb94ab163b2f7607f38d01753d286189ddcda259 /clojure/hello-world
parente4fd875702b7be18cfc3eccdb10fb21a065ae5e1 (diff)
downloadexercism-38b4e6fa229e65eae10f8a06c81ef1a0802d45f5.tar.gz
Clojure: Add Hello World solution and Two Fer exercise
Diffstat (limited to 'clojure/hello-world')
-rw-r--r--clojure/hello-world/HELP.md57
-rw-r--r--clojure/hello-world/README.md65
-rw-r--r--clojure/hello-world/project.clj4
-rw-r--r--clojure/hello-world/src/hello_world.clj4
-rw-r--r--clojure/hello-world/test/hello_world_test.clj6
5 files changed, 136 insertions, 0 deletions
diff --git a/clojure/hello-world/HELP.md b/clojure/hello-world/HELP.md
new file mode 100644
index 0000000..ff81e83
--- /dev/null
+++ b/clojure/hello-world/HELP.md
@@ -0,0 +1,57 @@
+# Help
+
+## Running the tests
+
+Leiningen can be used to run the exercise's test by running the following command from the exercise's directory:
+
+```bash
+lein test
+```
+
+## REPL
+
+To use the REPL to run the exercise's test, run the following command from the exercise's directory:
+
+```bash
+$ lein repl
+```
+
+Then `require` the exercise's test namespace and the Clojure test namespace):
+
+```clojure
+;; replace <exercise> with the exercise's name
+=> (require '<exercise>-test)
+```
+
+Then call `run-tests` on `<exercise>-test`:
+
+```clojure
+;; replace <exercise> with the exercise's name
+=> (clojure.test/run-tests '<exercise>-test)
+```
+
+## Submitting your solution
+
+You can submit your solution using the `exercism submit src/hello_world.clj` command.
+This command will upload your solution to the Exercism website and print the solution page's URL.
+
+It's possible to submit an incomplete solution which allows you to:
+
+- See how others have completed the exercise
+- Request help from a mentor
+
+## Need to get help?
+
+If you'd like help solving the exercise, check the following pages:
+
+- The [Clojure track's documentation](https://exercism.org/docs/tracks/clojure)
+- [Exercism's support channel on gitter](https://gitter.im/exercism/support)
+- The [Frequently Asked Questions](https://exercism.org/docs/using/faqs)
+
+Should those resources not suffice, you could submit your (incomplete) solution to request mentoring.
+
+To get help if you're having trouble, you can use one of the following resources:
+
+- [ClojureDocs](https://clojuredocs.org) A repository of language references and examples by function or keyword.
+- [/r/clojure](https://www.reddit.com/r/clojure) is the C# subreddit.
+- [StackOverflow](http://stackoverflow.com/questions/tagged/clojure) can be used to search for your problem and see if it has been answered already. You can also ask and answer questions.
\ No newline at end of file
diff --git a/clojure/hello-world/README.md b/clojure/hello-world/README.md
new file mode 100644
index 0000000..2426951
--- /dev/null
+++ b/clojure/hello-world/README.md
@@ -0,0 +1,65 @@
+# Hello World
+
+Welcome to Hello World on Exercism's Clojure Track.
+If you need help running the tests or submitting your code, check out `HELP.md`.
+
+## Instructions
+
+The classical introductory exercise. Just say "Hello, World!".
+
+["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
+the traditional first program for beginning programming in a new language
+or environment.
+
+The objectives are simple:
+
+- Write a function that returns the string "Hello, World!".
+- Run the test suite and make sure that it succeeds.
+- Submit your solution and check it at the website.
+
+If everything goes well, you will be ready to fetch your first real exercise.
+
+## Project Structure
+
+Clojure exercises in exercism use [leiningen](http://leiningen.org/) to configure and run your code
+and use [leiningen standard directory structure](https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#directory-layout).
+
+You will find a test file named `hello_world_test.clj` inside `test` directory.
+Write your code in `src/hello_world.clj`. It should use the namespace `hello-world` so that tests can pick it up.
+
+## Running tests
+
+Run the tests using `lein test` command and make them pass:
+
+```
+$ lein test
+
+lein test hello-world-test
+
+Ran 3 tests containing 3 assertions.
+0 failures, 0 errors.
+```
+
+Then submit the exercise using:
+
+```
+$ exercism submit src/hello_world.clj
+```
+
+For more detailed instructions and learning resources refer [exercism's clojure language page](http://exercism.io/languages/clojure).
+
+## Source
+
+### Contributed to by
+
+- @AndreaCrotti
+- @christianpoveda
+- @haus
+- @jcorrado
+- @sjwarner-bp
+- @tejasbubane
+- @yurrriq
+
+### Based on
+
+This is an exercise to introduce users to using Exercism - http://en.wikipedia.org/wiki/%22Hello,_world!%22_program
\ No newline at end of file
diff --git a/clojure/hello-world/project.clj b/clojure/hello-world/project.clj
new file mode 100644
index 0000000..b6b1aec
--- /dev/null
+++ b/clojure/hello-world/project.clj
@@ -0,0 +1,4 @@
+(defproject hello-world "0.1.0-SNAPSHOT"
+  :description "hello-world exercise."
+  :url "https://github.com/exercism/clojure/tree/master/exercises/hello-world"
+  :dependencies [[org.clojure/clojure "1.10.0"]])
diff --git a/clojure/hello-world/src/hello_world.clj b/clojure/hello-world/src/hello_world.clj
new file mode 100644
index 0000000..b81d18f
--- /dev/null
+++ b/clojure/hello-world/src/hello_world.clj
@@ -0,0 +1,4 @@
+(ns hello-world)
+
+(defn hello []
+  "Hello, World!")
diff --git a/clojure/hello-world/test/hello_world_test.clj b/clojure/hello-world/test/hello_world_test.clj
new file mode 100644
index 0000000..ce032d9
--- /dev/null
+++ b/clojure/hello-world/test/hello_world_test.clj
@@ -0,0 +1,6 @@
+(ns hello-world-test
+  (:require [clojure.test :refer [deftest is]]
+            hello-world))
+
+(deftest hello-world-test
+  (is (= "Hello, World!" (hello-world/hello))))