Random Numbers? - page 3 - Script Writing - CHDK Forum  

Random Numbers?

  • 23 Replies
  • 15727 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Random Numbers?
« Reply #20 on: 30 / April / 2008, 06:22:43 »
Advertisements
okay, next try:

edited my code, now it uses luminance, battery voltage & tickcount as seed.
Code: (c) [Select]
static void random_statement()
 {
     int var;
     accept(TOKENIZER_RANDOM);
     var = tokenizer_variable_num();
     accept(TOKENIZER_VARIABLE);
     srand((int)shooting_get_bv96()+(unsigned short)stat_get_vbatt()+get_tick_count());
     ubasic_camera_sleep(rand()%10);
     ubasic_set_variable(var, rand());
this happens when you call random from ubasic. as i am no fulltime coder i dont really know if this makes sense in a "random" way of sense. but i know that the outcome is much better than my last try.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Random Numbers?
« Reply #21 on: 08 / May / 2008, 03:45:59 »
hey ab, i read in your blog that you finished the script. also you wrote a new script (time bandit) which sounds very interesting. care to share that in the "completed scripts" section of the forum, together with the random script? i guess the random script does use the build provided by me or jucifer, right?

*

Offline ab

  • *
  • 17
Re: Random Numbers?
« Reply #22 on: 19 / May / 2008, 20:41:00 »
PhyrePhox - sorry for the long delay.  I need to remember to click the "email me when someone responds" button.

I will upload them both to the completed scripts section of the forum.  The random numbers inside the focus wobble rely on your build ... will that be a problem?

Thanks for checking out my blog.  I owe a great deal to all the work people here have done.  I've been shooting single frame animation movies for years ... and now my Canon A640 is my favorite camera for that application.

I have quite a few test films on my site too ... if anyone is interested in how these scripts come together.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Random Numbers?
« Reply #23 on: 20 / May / 2008, 09:07:19 »
those videos of yours - amazing. living proof that you dont need expensive equipment to produce high quality movies/pictures. the random command will *probably* be included in the official build soon, so i guess it isnt a problem (also, you mentioned in the script's thread that it needs my build, so no "customers" can complain :D).
let us know when your combat movie is finished :)
« Last Edit: 20 / May / 2008, 09:09:09 by PhyrePhoX »


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal