From 914d4397eec93dd35030bbdc5ea88239c7b37a9e Mon Sep 17 00:00:00 2001 From: markop Date: Fri, 17 Jul 2015 10:18:41 +0200 Subject: sins --- sins.py | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sins.py (limited to 'sins.py') diff --git a/sins.py b/sins.py new file mode 100644 index 0000000..b37d154 --- /dev/null +++ b/sins.py @@ -0,0 +1,190 @@ +# coding=utf-8 +# najprej opis +description = """\ +

Sins

+

Predikat sins(X, SortedList, NewSortedList) naredi seznam NewSortedList tako, da vstavi element X na ustrezno mesto v sortiran (v nepadajočem vrstnem redu) seznam SortedList.

+

Ta lahko vsebuje podvojene elemente; tudi element x se lahko že pojavi v njem.

+

Primera:

+

+?- sins(4, [1,2,3,5], L).
+  L = [1,2,3,4,5].
+?- sins(3, [1,2,3,4], L).
+  L = [1,2,3,3,4]. +

""" + +# in zdaj hinti +hint = {} # to je komentar +hint['list_empty'] = { + 'type': 'static', + 'message': """ +Kaj se zgodi, če je SortedList prazen?
+ xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + viewBox="0 0 150 70" + preserveAspectRatio="xMidYMid" + version="1.1"> + Animates sorted insert (sins/3) with rectangles. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Am I bigger than you? Yes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +""" +} + +hint['new_largest_element'] = { + 'type': 'static', + 'message': "Kaj se zgodi, če vstavljamo nov največji element?" +} +hint['new_lowest_element'] = { + 'type': 'static', + 'message': "Kaj se zgodi, če vstavljamo nov najmanjši element?" +} +hint['y_less_then_x'] = { + 'type': 'static', + 'message': "Manjka veja rekurzije, ki preskakuje elemente, manjše od X." +} +hint['x_compare_list_head'] = { + 'type': 'static', + 'message': "V obeh vejah rekurzije je potrebno primerjati X z glavo seznama, sicer dobimo več (nepravilnih) rešitev." +} +hint['y_less_then_x_add_new'] = { + 'type': 'static', + 'message': "Pri preskakovanju elementov, manjših od X, jih ne doda v nov seznam." +} + +# a drop-down hint must supply the arguments: start (int), end (int), choices (array of string) +hint['drop_down'] = { + 'type': 'dropdown' +} +# a pop-up hint must supply the arguments: start (int), end (int), args (object of key-value args for the template, optional) +hint['popup_unknown'] = { + 'type': 'popup', + 'message': 'nekaj si zabluzil v vrstici [%=row%]' +} +# a static hint can supply an optional argument: args (object of key-value args for the template) +# a static hint can also be defined as a string instead of an object +hint['sample_static'] = { + 'type': 'static', + 'message': 'A sample static hint' +} -- cgit v1.2.1