Exact kilometer announcements (fr) - needs nightly build 2011-08-14 or later!
This commit is contained in:
parent
10a703879b
commit
d6af998f73
1 changed files with 4 additions and 41 deletions
|
@ -20,7 +20,6 @@ turn(Turn, Dist) == ['Dans ', D, M] :-
|
|||
distance(Dist) == D, turn(Turn, M).
|
||||
turn(Turn) == M :- turn(Turn, M).
|
||||
|
||||
|
||||
prepare_make_ut(Dist) == ['Dans ', D, ' préparez vous à faire demi tour'] :-
|
||||
distance(Dist) == D.
|
||||
|
||||
|
@ -64,48 +63,12 @@ nth(15, '15ème ').
|
|||
nth(16, '16ème ').
|
||||
nth(17, '17ème ').
|
||||
|
||||
|
||||
%%% distance measure
|
||||
distance(Dist) == T :- Dist < 1000, dist(Dist, F), append(F, ' metres',T).
|
||||
dist(D, ['10 ']) :- D < 15, !.
|
||||
dist(D, ['20 ']) :- D < 25, !.
|
||||
dist(D, ['30 ']) :- D < 35, !.
|
||||
dist(D, ['40 ']) :- D < 45, !.
|
||||
dist(D, ['50 ']) :- D < 55, !.
|
||||
dist(D, ['60 ']) :- D < 65, !.
|
||||
dist(D, ['70 ']) :- D < 75, !.
|
||||
dist(D, ['80 ']) :- D < 85, !.
|
||||
dist(D, ['90 ']) :- D < 95, !.
|
||||
dist(D, ['100 ']) :- D < 125, !.
|
||||
dist(D, ['150 ']) :- D < 175, !.
|
||||
dist(D, ['200 ']) :- D < 225, !.
|
||||
dist(D, ['250 ']) :- D < 275, !.
|
||||
dist(D, ['300 ']) :- D < 325, !.
|
||||
dist(D, ['350 ']) :- D < 375, !.
|
||||
dist(D, ['400 ']) :- D < 425, !.
|
||||
dist(D, ['450 ']) :- D < 475, !.
|
||||
dist(D, ['500 ']) :- D < 525, !.
|
||||
dist(D, ['550 ']) :- D < 575, !.
|
||||
dist(D, ['600 ']) :- D < 625, !.
|
||||
dist(D, ['650 ']) :- D < 675, !.
|
||||
dist(D, ['700 ']) :- D < 725, !.
|
||||
dist(D, ['750 ']) :- D < 775, !.
|
||||
dist(D, ['800 ']) :- D < 825, !.
|
||||
dist(D, ['850 ']) :- D < 875, !.
|
||||
dist(D, ['900 ']) :- D < 925, !.
|
||||
dist(D, ['950 ']) :- D < 975, !.
|
||||
dist(D, ['1000 ']) :- !.
|
||||
|
||||
distance(Dist) == [ X, ' metres'] :- Dist < 100, D is round(Dist/10)*10, num_atom(D, X).
|
||||
distance(Dist) == [ X, ' metres'] :- Dist < 1000, D is round(2*Dist/100)*50, num_atom(D, X).
|
||||
distance(Dist) == ['quelque 1 kilometre '] :- Dist < 1500.
|
||||
distance(Dist) == ['quelques 2 kilometres '] :- Dist < 2500.
|
||||
distance(Dist) == ['quelques 3 kilometres '] :- Dist < 3500.
|
||||
distance(Dist) == ['quelques 4 kilometres '] :- Dist < 4500.
|
||||
distance(Dist) == ['quelques 5 kilometres '] :- Dist < 5500.
|
||||
distance(Dist) == ['quelques 6 kilometres '] :- Dist < 6500.
|
||||
distance(Dist) == ['quelques 7 kilometres '] :- Dist < 7700.
|
||||
distance(Dist) == ['quelques 8 kilometres '] :- Dist < 8500.
|
||||
distance(Dist) == ['quelques 9 kilometres '] :- Dist < 9500.
|
||||
distance(Dist) == ['quelques ', X, ' kilomètres '] :- D is Dist/1000, dist(D, X).
|
||||
distance(Dist) == ['quelques ', X, ' kilomètres '] :- Dist < 10000, D is round(Dist/1000), num_atom(D, X).
|
||||
distance(Dist) == [ X, ' kilomètres '] :- D is round(Dist/1000), num_atom(D, X).
|
||||
|
||||
%% resolve command main method
|
||||
%% if you are familar with Prolog you can input specific to the whole mechanism,
|
||||
|
|
Loading…
Reference in a new issue