diff options
Diffstat (limited to 'prolog')
-rw-r--r-- | prolog/problems/world_data/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/flows_2/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/flows_2/en.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/flows_2/sl.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/grant_1/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/holiday_2/en.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/holiday_2/sl.py | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/intro_sl.html | 2 | ||||
-rw-r--r-- | prolog/problems/world_data/people_in_capitals_1/common.py | 8 | ||||
-rw-r--r-- | prolog/problems/world_data/similar_population_3/common.py | 17 |
10 files changed, 22 insertions, 19 deletions
diff --git a/prolog/problems/world_data/common.py b/prolog/problems/world_data/common.py index 0d2730a..006b9f5 100644 --- a/prolog/problems/world_data/common.py +++ b/prolog/problems/world_data/common.py @@ -1,2 +1,2 @@ id = 1002 -number = 140 +number = 20 diff --git a/prolog/problems/world_data/flows_2/common.py b/prolog/problems/world_data/flows_2/common.py index a3cf79b..a3ddc7a 100644 --- a/prolog/problems/world_data/flows_2/common.py +++ b/prolog/problems/world_data/flows_2/common.py @@ -6,7 +6,7 @@ from server.hints import Hint import server.problems id = 10009 -number = 90 +number = 55 visible = True facts = 'mondial' diff --git a/prolog/problems/world_data/flows_2/en.py b/prolog/problems/world_data/flows_2/en.py index f108001..355b238 100644 --- a/prolog/problems/world_data/flows_2/en.py +++ b/prolog/problems/world_data/flows_2/en.py @@ -13,7 +13,7 @@ ending in the Black Sea:</p> <p>River data is given by the predicate</p> <pre> river(Name, FlowsToRiver, FlowsToLake, FlowsToSea, Length, Area, - SourceLat, SourceLon, SourceElevation, MouthLat, MouthLon). + SourceLat, SourceLon, SourceName, SourceElevation, MouthLat, MouthLon). </pre> ''' diff --git a/prolog/problems/world_data/flows_2/sl.py b/prolog/problems/world_data/flows_2/sl.py index ef46f6b..7af2a7d 100644 --- a/prolog/problems/world_data/flows_2/sl.py +++ b/prolog/problems/world_data/flows_2/sl.py @@ -12,7 +12,7 @@ ki se priključi Donavi, ki teče v Črno morje, zato naj program odgovori tako: <p>Podatki o rekah so predstavljeni s predikatom</p> <pre> river(Name, FlowsToRiver, FlowsToLake, FlowsToSea, Length, Area, - SourceLat, SourceLon, SourceElevation, MouthLat, MouthLon). + SourceLat, SourceLon, SourceName, SourceElevation, MouthLat, MouthLon). </pre> <p>Za vsako reko je podan največ en izmed argumentov <code>FlowsToRiver</code>, <code>FlowsToLake</code> in <code>FlowsToSea</code>, ki pove, v katero reko, diff --git a/prolog/problems/world_data/grant_1/common.py b/prolog/problems/world_data/grant_1/common.py index 8c032a3..4b5918a 100644 --- a/prolog/problems/world_data/grant_1/common.py +++ b/prolog/problems/world_data/grant_1/common.py @@ -5,7 +5,7 @@ from server.hints import Hint import server.problems id = 10007 -number = 70 +number = 45 visible = True facts = 'mondial' diff --git a/prolog/problems/world_data/holiday_2/en.py b/prolog/problems/world_data/holiday_2/en.py index ecb248a..a7f4f07 100644 --- a/prolog/problems/world_data/holiday_2/en.py +++ b/prolog/problems/world_data/holiday_2/en.py @@ -10,7 +10,7 @@ ki ima morje.</p> Neighbour = 'Italy' ; Neighbour = 'Croatia' </pre> -<p>Prav ti znajo priti podatki v obliki <code>borders(Country1, Country2, LenOfBorder)</code> in +<p>Prav ti znajo priti podatki v obliki <code>borders(CountryCode1, CountryCode2, LenOfBorder)</code> in <code>geo_sea(Sea, CountryCode, Province)</code>.</p> ''' diff --git a/prolog/problems/world_data/holiday_2/sl.py b/prolog/problems/world_data/holiday_2/sl.py index ecb248a..a7f4f07 100644 --- a/prolog/problems/world_data/holiday_2/sl.py +++ b/prolog/problems/world_data/holiday_2/sl.py @@ -10,7 +10,7 @@ ki ima morje.</p> Neighbour = 'Italy' ; Neighbour = 'Croatia' </pre> -<p>Prav ti znajo priti podatki v obliki <code>borders(Country1, Country2, LenOfBorder)</code> in +<p>Prav ti znajo priti podatki v obliki <code>borders(CountryCode1, CountryCode2, LenOfBorder)</code> in <code>geo_sea(Sea, CountryCode, Province)</code>.</p> ''' diff --git a/prolog/problems/world_data/intro_sl.html b/prolog/problems/world_data/intro_sl.html index 2d27780..12a9701 100644 --- a/prolog/problems/world_data/intro_sl.html +++ b/prolog/problems/world_data/intro_sl.html @@ -36,7 +36,7 @@ lake(Name, Area, Depth, Elevation, Type, River, Latitude, Longitude) riverthrough(River, Lake) island(Name, Group, Area, Elevation, Type, Latitude, Longitude) mountain(Name, Range, Height, Type, Latitude, Longitude) -desert(Name, Area, Longitude, Latitude, Longitude) +desert(Name, Area, Latitude, Longitude) geo_sea(Sea, CountryCode, Province) mergesWith(Sea1, Sea2) located(City, Province, CountryCode, River, Lake, Sea) diff --git a/prolog/problems/world_data/people_in_capitals_1/common.py b/prolog/problems/world_data/people_in_capitals_1/common.py index b38a96f..cda2e06 100644 --- a/prolog/problems/world_data/people_in_capitals_1/common.py +++ b/prolog/problems/world_data/people_in_capitals_1/common.py @@ -13,17 +13,17 @@ facts = 'mondial' solution = '''\ people_in_capitals(N) :- findall(Pop, - (country(_,_,Capital,_,_,_), - city(Capital,_,_,Pop,_,_,_), + (country(_,ID,Capital,_,_,_), + city(Capital,ID,_,Pop,_,_,_), number(Pop)), L), - sum(L, N). + sum_list(L, N). ''' hint_type = { } test_cases = [ - ('people_in_capitals(N)', [{'N': '316277426'}]), + ('people_in_capitals(N)', [{'N': '313163317'}]), # old solution without equal IDs [{'N': '316277426'}] ] def test(code, aux_code): diff --git a/prolog/problems/world_data/similar_population_3/common.py b/prolog/problems/world_data/similar_population_3/common.py index a984f1c..b8a391c 100644 --- a/prolog/problems/world_data/similar_population_3/common.py +++ b/prolog/problems/world_data/similar_population_3/common.py @@ -11,19 +11,22 @@ facts = 'mondial' solution = '''\ simpop(X, Y, D):- - findall(D/X/Y, (country(X,_,_,_,_,PX), country(Y,_,_,_,_,PY), X \== Y, D is abs(PX-PY)), L), - sort(L, [D/X/Y|_]). + country(X,_,_,_,_,PX), + country(Y,_,_,_,_,PY), + X \== Y, + D is abs(PX-PY), + \+ (country(Z,_,_,_,_,PZ), Z \== X, D > abs(PX-PZ)). ''' test_cases = [ - ('simpop(X, Y, D)', - [{'X': "'Grenada'", 'Y': "'Tonga'", 'D': '76'}]), + ("simpop('Tonga', Y, D)", + [{'Y': "'Grenada'", 'D': '76'}]), ("simpop('Slovenia', Y, D)", [{'Y': "'Macedonia'", 'D': '973'}]), - ("simpop(X, 'Australia', D)", - [{'X': "'Taiwan'", 'D': '180541'}]), + ("simpop(X, 'Slovenia', D)", + [{'X': "'Macedonia'", 'D': '973'}, {'X': "'Botswana'", 'D': '20593'}]), ("simpop(X, Y, 1176831)", - [{'X': "'Uzbekistan'", 'Y': "'Venezuela'"}]), + [{'Y': "'Uzbekistan'", 'X': "'Venezuela'"}]), ] def test(code, aux_code): |