Fork, Commit, Merge - Easy Issue (Clojure)
nikohoffren opened this issue · comments
Fork, Commit, Merge - Easy Issue (Clojure)
Create a Simple Number Addition Function in Clojure
Note: You don't have ask permission to start solving the issue or get assigned, since these issues are supposed to be always open for new contributors. The actions-user bot will reset the file back to previous state for the next contributor after your commit is merged. So you can just simply start working with the issue right away!
Description:
In this task, you're expected to implement a simple Clojure function that adds two numbers and prints the result in a formatted string.
Requirements:
Implement a function named add-numbers that:
- Takes in two arguments, x and y, which will be numbers.
- Prints the result in the format: "The sum of x and y is: result".
Example:
For input values of 3 and 5, your function should print:
The sum of 3 and 5 is: 8
To get started, open the tasks/clojure/easy/add-numbers/src/add_numbers
directory from the root of the project.
After that, open the core.clj
file to start implementing the solution!
To test the program, you can use REPL with Calva VS Code extension. If you don't have them installed, go check out the Installing Clojure section in README.md.
To run the program, use Ctrl+Shift+C and after that Ctrl+Shift+J to open Project Type/Connect Sequence on top of the VS Code. From there, select fork-commit-merge/tasks/clojure/easy/add-numbers
and press Enter.
After that you need to select Leiningen
and press Enter.
Now the REPL server is running.
On the right side of the screen you should now see output.calva.repl
file opened, where under this text clj꞉add-numbers.core꞉>
you can add commands.
Write command (add-numbers 3 5)
and press Enter.
If the function works like expected, you should now see The sum of 3 and 5 is: 8
text, which means you are ready to make a pull request!
To work with this issue, you need to have Clojure and Leiningen installed to your local machine.
Check out README.md for more instructions of installing Clojure and Leiningen and how to make a pull request.
Feel free to ask any questions here if you have some problems!