Author Topic: [challenge] A25 : Lottery draw numbers within range  (Read 1391 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12696
  • London, England
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #15 on: February 16, 2022, 10:44:57 AM »
I wrote this as a bit of fun around 10 years ago, but it focuses far more on the visual output than any kind of elegance in the selection of numbers...  :uglystupid2:

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1314
  • Marco
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #16 on: February 16, 2022, 01:11:16 PM »
I wrote this as a bit of fun around 10 years ago, but it focuses far more on the visual output than any kind of elegance in the selection of numbers...  :uglystupid2:
Grande!  :) :wideeyed:

JohnK

  • Administrator
  • Seagull
  • Posts: 10140
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #17 on: February 16, 2022, 08:34:00 PM »
Pretty. Looks like Christmas tree lights. :)
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7323
  • AKA Daniel
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #18 on: February 17, 2022, 04:23:28 AM »
posted this in 2006  :lol:  probably doesn't work
https://www.theswamp.org/index.php?topic=13837.msg166923#msg166923
Retired

kirby

  • Newt
  • Posts: 110
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #19 on: February 17, 2022, 02:23:11 PM »
Lunchtime fun - wrote a little histogram plotter as visual aid for random number generator.  Should be close to a uniform distribution, plug yours in and test it.  Won't abandon Excel quite yet...


JohnK

  • Administrator
  • Seagull
  • Posts: 10140
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #20 on: February 17, 2022, 02:35:35 PM »
Cool!
...The one I tested (the one I used for this challenge) is not that flat. Humm?!
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

ribarm

  • Gator
  • Posts: 2747
  • Marko Ribar, architect
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #21 on: February 19, 2022, 07:37:48 AM »
I don't know where did I get it, but I've found it in my library...

Code - Auto/Visual Lisp: [Select]
  1. (defun random ( )
  2.     ;;  return real between 0 and 1
  3.     (defun random ( )
  4.         (setq *random*
  5.             (   (lambda ( x ) (- x (fix x)))
  6.                 (expt (+ pi *random*) (+ 5 *random*))
  7.             )
  8.         )
  9.     )
  10.     (setq *random*
  11.         (   (lambda ( x ) (- x (fix x)))
  12.             (expt (+ pi (/ 1.0 (getvar 'millisecs))) (rem (getvar 'millisecs) pi))
  13.         )
  14.     )
  15. )
  16.  
  17. ;;; (random) => number between 0 and 1
  18.  
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

Lee Mac

  • Seagull
  • Posts: 12696
  • London, England
Re: [challenge] A25 : Lottery draw numbers within range
« Reply #22 on: February 20, 2022, 06:51:05 AM »
I don't know where did I get it, but I've found it in my library...

Knew it was MP the moment I saw it -
https://www.theswamp.org/index.php?topic=55570.msg597179#msg597179
RIP MP :cry: