From 98e604d89140adc812a50ab991abb33f1f3207d0 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Wed, 19 Sep 2018 12:45:59 +0300 Subject: [PATCH] Add script --- PR02/prax02.pl | 22 +++++++++++++++------- auto_commit.sh | 9 +++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100755 auto_commit.sh diff --git a/PR02/prax02.pl b/PR02/prax02.pl index d7039e1..8a1d34b 100755 --- a/PR02/prax02.pl +++ b/PR02/prax02.pl @@ -1,6 +1,6 @@ #!/usr/bin/swipl married(liisa, joosep). -married(anne,vello). +married(anne, vello). mother(evelin,anne). mother(mikk, anne). mother(juku, anne). @@ -8,7 +8,7 @@ mother(anne, liisa). mother(mart, liisa). female(anne). female(evelin). -female(anne). +female(liisa). male(vello). male(mikk). male(juku). @@ -32,10 +32,18 @@ sister(Laps, Ode):- female(Ode). uncle(Laps, Uncle):- - mother(Laps, Ema), - brother(Ema, Uncle). + (mother(Laps, Vanem); father(Laps, Vanem)), + brother(Vanem, Uncle). -uncle(Laps, Uncle):- - father(Laps, Isa), - brother(Isa, Uncle). +aunt(Laps, Aunt):- + (mother(Laps, Vanem); father(Laps, Vanem)), + sister(Vanem, Aunt). + +grandmother(Laps, GM):- + (mother(Laps, Vanem); father(Laps, Vanem)), + mother(Vanem, GM). + +grandfather(Laps, GF):- + (mother(Laps, Vanem); father(Laps, Vanem)), + father(Vanem, GF). diff --git a/auto_commit.sh b/auto_commit.sh new file mode 100755 index 0000000..1c0f150 --- /dev/null +++ b/auto_commit.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +while true; do + if git diff --exit-code --name-only; then + sleep 1 + else + git commit -a --amend -C HEAD && git push --force + fi +done