From 321825828ac918bad28d0597a8616c6dc9802c3c Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 11 Aug 2021 15:26:15 +0530 Subject: Add solved exercises --- emacs-lisp/hello-world/README.md | 21 +++++++++++++++++++++ emacs-lisp/hello-world/hello-world-test.el | 15 +++++++++++++++ emacs-lisp/hello-world/hello-world.el | 12 ++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 emacs-lisp/hello-world/README.md create mode 100644 emacs-lisp/hello-world/hello-world-test.el create mode 100644 emacs-lisp/hello-world/hello-world.el (limited to 'emacs-lisp/hello-world') diff --git a/emacs-lisp/hello-world/README.md b/emacs-lisp/hello-world/README.md new file mode 100644 index 0000000..96e5c95 --- /dev/null +++ b/emacs-lisp/hello-world/README.md @@ -0,0 +1,21 @@ +# Hello World + +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 `hello` 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. +## Source + +This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. diff --git a/emacs-lisp/hello-world/hello-world-test.el b/emacs-lisp/hello-world/hello-world-test.el new file mode 100644 index 0000000..f5f6ce0 --- /dev/null +++ b/emacs-lisp/hello-world/hello-world-test.el @@ -0,0 +1,15 @@ +;;; hello-world-test.el --- Tests for Hello World (exercism) + +;;; Commentary: +;; Common test data version: 1.1.0 be3ae66 + +;;; Code: + +(load-file "hello-world.el") + +(ert-deftest hello-world-test () + (should (string= (hello) "Hello, World!"))) + +(provide 'hello-world-test) + +;;; hello-world-test.el ends here diff --git a/emacs-lisp/hello-world/hello-world.el b/emacs-lisp/hello-world/hello-world.el new file mode 100644 index 0000000..162688b --- /dev/null +++ b/emacs-lisp/hello-world/hello-world.el @@ -0,0 +1,12 @@ +;;; hello-world.el --- Hello World Exercise (exercism) + +;;; Commentary: + +;;; Code: + + +(defun hello () + "Hello, World!") + +(provide 'hello-world) +;;; hello-world.el ends here -- cgit 1.4.1-2-gfad0