diff options
author | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2016-08-09 15:17:46 +0200 |
---|---|---|
committer | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2016-08-09 15:17:46 +0200 |
commit | a30f8224b0da43b17d19acba896182418caf979b (patch) | |
tree | bc16446317deee21f9574d21df10829e345c156d /prolog | |
parent | e4785eb34e27fdc65833baf73066920a8ba8fb0e (diff) | |
parent | 8f634d6b940d5ebd92fa1a951fcf04ed2d2c433b (diff) |
Merge branch 'master' of ssh://192.168.15.97/codeq-problems
Diffstat (limited to 'prolog')
-rw-r--r-- | prolog/common.py | 3 | ||||
-rw-r--r-- | prolog/problems/lists_advanced/rev_2/common.py | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/prolog/common.py b/prolog/common.py index 8e3d91d..e591e0b 100644 --- a/prolog/common.py +++ b/prolog/common.py @@ -1,4 +1,6 @@ import operator +import socket + import prolog.engine from prolog.util import tokenize from server.hints import Hint, HintPopup @@ -22,6 +24,7 @@ hint_type = { # Check program for syntax errors. def check_syntax(code, aux_code): + engine_id = None try: engine_id, output = prolog.engine.create(code=code+aux_code, timeout=1.0) if 'error' in map(operator.itemgetter(0), output): diff --git a/prolog/problems/lists_advanced/rev_2/common.py b/prolog/problems/lists_advanced/rev_2/common.py index b673660..f79ddca 100644 --- a/prolog/problems/lists_advanced/rev_2/common.py +++ b/prolog/problems/lists_advanced/rev_2/common.py @@ -39,6 +39,10 @@ hint_type = { test_cases = [ ('rev([], X)', [{'X': '[]'}]), + ('rev(X, [])', + [{'X': '[]'}]), + ('rev([42], X)', + [{'X': '[42]'}]), ('rev([s, k, c, d, d], X)', [{'X': '[d, d, c, k, s]'}]), ('rev(X, [s, k, c, d, d])', |