Skip to content

Commit

Permalink
feat: update config.json and add hello-world exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
GroophyLifefor committed Jan 5, 2024
1 parent 066dbf3 commit 3b981df
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 2 deletions.
15 changes: 13 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"representer": false,
"analyzer": false
},
"blurb": "TODO: add blurb",
"blurb": "Sequential commands automate tasks in Windows OS via .bat or .cmd files.",
"version": 3,
"online_editor": {
"indent_style": "space",
Expand All @@ -22,7 +22,18 @@
},
"exercises": {
"concept": [],
"practice": []
"practice": [
{
"uuid": "d4919f7e-5e88-48a1-a357-e79cd6f98346",
"slug": "hello-world",
"name": "Hello World",
"practices": [
"basics"
],
"prerequisites": [],
"difficulty": 1
}
]
},
"concepts": [],
"key_features": [],
Expand Down
16 changes: 16 additions & 0 deletions exercises/practice/hello-world/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Instructions

The classical introductory exercise.
Just say "Hello, World!".

["Hello, World!"][hello-world] is the traditional first program for beginning programming in a new language or environment.

The objectives are simple:

- Modify the provided code so that it produces 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.

[hello-world]: https://en.wikipedia.org/wiki/%22Hello,_world!%22_program
17 changes: 17 additions & 0 deletions exercises/practice/hello-world/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"authors": ["GroophyLifefor"],
"files": {
"solution": [
"src/main/Greeter.bat"
],
"test": [
"src/test/GreeterTest.bat"
],
"example": [
".meta/src/reference/Greeter.bat"
]
},
"blurb": "Exercism's classic introductory exercise. Just say \"Hello, World!\".",
"source": "This is an exercise to introduce users to using Exercism",
"source_url": "https://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@echo Hello, World!
13 changes: 13 additions & 0 deletions exercises/practice/hello-world/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[af9ffe10-dc13-42d8-a742-e7bdafac449d]
description = "Say Hi!"
1 change: 1 addition & 0 deletions exercises/practice/hello-world/src/main/Greeter.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@Echo Goodbye, Me!
23 changes: 23 additions & 0 deletions exercises/practice/hello-world/src/test/Greeter.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@echo off
REM ---------------------------------------------------
REM testThatGreeterReturnsTheCorrectGreeting
REM ---------------------------------------------------

REM Initalize result variable
set "result="
set "expected=Hello, World!"
REM Run the program and store the output in the result variable
for /f "delims=" %%a in ('%~1') do set result=%%a

REM Check if the result is correct
if "%result%" == "%expected%" (
REM If the result is correct, exit with code 0
echo Test passed
exit /b 0
) else (
REM If the result is incorrect, exit with code 1
echo Expected: %expected%
echo Actually: %result%
echo Test failed
exit /b 1
)

0 comments on commit 3b981df

Please sign in to comment.