DEV Community

Discussion on: Daily Challenge #75 - Set Alarm

Collapse
 
willsmart profile image
willsmart

How about prolog?
A file with one fact should do it...

setAlarm(true,false).

To run..

> gprolog --consult-file setAlarm.pl
GNU Prolog 1.4.5 (64 bits)
Compiled Aug 20 2018, 15:27:00 with clang
By Daniel Diaz
Copyright (C) 1999-2018 Daniel Diaz
compiling /Users/Will/setAlarm.pl for byte code...
/Users/Will/setAlarm.pl compiled, 1 lines read - 257 bytes written, 4 ms
| ?- setAlarm(false,false).

no
| ?- setAlarm(false,true).

no
| ?- setAlarm(true,false).

yes
| ?- setAlarm(true,true).

no
Collapse
 
not_jffrydsr profile image
@nobody

Prolog still scares me . . . not its syntax, but seemingly untapped potential.