Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -0,0 +1,3 @@
numeric_string(String) :-
atom_string(Atom, String),
atom_number(Atom, _).

View file

@ -0,0 +1,8 @@
test_strings(Strings) :-
forall( member(String, Strings),
( ( numeric_string(String)
-> Result = a
; Result = 'not a' ),
format('~w is ~w number.~n', [String, Result])
)
).

View file

@ -0,0 +1,7 @@
?- test_strings(["123", "0.123", "-123.1", "NotNum", "1."]).
123 is a number.
0.123 is a number.
-123.1 is a number.
NotNum is not a number.
1. is not a number.
true.