Commit 693d4bc8 authored by Christian Persch's avatar Christian Persch

guile: Rename "random" function

Rename "random" function to "aisleriot-random" since it clashes with
a guile builtin function.
parent 9eaa9b26
......@@ -191,7 +191,7 @@
(_"When without a stapler, a staple and a ruler will work")
; Translators: This is one of the sentences that are used when the user wants to get a hint. Since the 'clock' game is a joke in itself, the sentence it nonsensical and/or a joke. So you can substitute anything you like here; you don't have to translate the original sentence!
(_"Never blow in a dog's ear"))
(random 12))))
(aisleriot-random 12))))
(define (get-options) #f)
......
......@@ -87,7 +87,7 @@
(deepest (apply max holes))
(total (apply + holes))
(n (apply + (map (lambda (x) (if (= (car x) 0) 0 1)) slots)))
(r (random n)))
(r (aisleriot-random n)))
(if (<= total (* deepest 2)) ; Catch the case where we are forced to
; fill in a hole
(find-deepest holes deepest)
......@@ -95,7 +95,7 @@
(define (select-second slots first)
(let* ((n (apply + (map (lambda (x) (if (= (car x) 0) 0 1)) slots)))
(r (random (- n 1))))
(r (aisleriot-random (- n 1))))
(find-hole slots r first)))
; Accepts a source slot and a list of count, slot-id pairs and distributes
......
......@@ -584,7 +584,7 @@
(define (shuffle-deck-helper deck result ref1 len)
(if (zero? len)
result
(let* ((ref2 (+ ref1 (random len)))
(let* ((ref2 (+ ref1 (aisleriot-random len)))
(val-at-ref2 (vector-ref deck ref2)))
(vector-set! deck ref2 (vector-ref deck ref1))
(shuffle-deck-helper deck (cons val-at-ref2 result) (+ ref1 1) (- len 1)))))
......
......@@ -1068,7 +1068,7 @@ cscm_init (void)
scm_c_define_gsubr ("set-slot-x-expansion!", 2, 0, 0,
scm_set_slot_x_expansion);
scm_c_define_gsubr ("set-lambda", 8, 0, 1, scm_set_lambda);
scm_c_define_gsubr ("random", 1, 0, 0, scm_myrandom);
scm_c_define_gsubr ("aisleriot-random", 1, 0, 0, scm_myrandom);
scm_c_define_gsubr ("click-to-move?", 0, 0, 0, scm_click_to_move_p);
scm_c_define_gsubr ("get-score", 0, 0, 0, scm_get_score);
scm_c_define_gsubr ("set-score!", 1, 0, 0, scm_set_score);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment