Adding all tracks, I guess
This commit is contained in:
21
prolog/hello-world/README.md
Normal file
21
prolog/hello-world/README.md
Normal file
@@ -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 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.
|
9
prolog/hello-world/hello_world.pl
Normal file
9
prolog/hello-world/hello_world.pl
Normal file
@@ -0,0 +1,9 @@
|
||||
% Please visit http://exercism.io/languages/prolog/installation
|
||||
% for instructions on setting up prolog.
|
||||
% Visit http://exercism.io/languages/prolog/tests
|
||||
% for help running the tests for prolog exercises.
|
||||
|
||||
% Replace the goal below with
|
||||
% your implementation.
|
||||
|
||||
hello_world(false).
|
31
prolog/hello-world/hello_world_tests.plt
Normal file
31
prolog/hello-world/hello_world_tests.plt
Normal file
@@ -0,0 +1,31 @@
|
||||
% Please visit http://exercism.io/languages/prolog/installation
|
||||
% for instructions on setting up prolog.
|
||||
% Visit http://exercism.io/languages/prolog/tests
|
||||
% for help running the tests for prolog exercises.
|
||||
|
||||
% The goal below allows tests to be skipped
|
||||
% unless the "--all" flag is passed at
|
||||
% the command line.
|
||||
|
||||
pending :-
|
||||
current_prolog_flag(argv, ['--all'|_]).
|
||||
pending :-
|
||||
write('\nA TEST IS PENDING!\n'),
|
||||
fail.
|
||||
|
||||
:- begin_tests(hello_world).
|
||||
|
||||
test(hello_world, condition(true)) :-
|
||||
hello_world('Hello World!').
|
||||
|
||||
% Once the first test passes, un-skip the following test by
|
||||
% changing `pending` in `condition(pending)` to `true`.
|
||||
% Repeat for each test until they are all passing.
|
||||
|
||||
test(hello_world_with_a_name, condition(pending)) :-
|
||||
hello_world('Alice', 'Hello Alice!').
|
||||
|
||||
test(hello_world_another_name, condition(pending)) :-
|
||||
hello_world('Bob', 'Hello Bob!').
|
||||
|
||||
:- end_tests(hello_world).
|
Reference in New Issue
Block a user