[Ma...] Posted February 18, 2022 Share Posted February 18, 2022 Hi to all, is there any possibility in Calypso 7.2 via PCM to generate random number witch would then be used in the calculation formula. Link to comment Share on other sites More sharing options...
[No...] Posted February 18, 2022 Share Posted February 18, 2022 Not with official PCM commands. Possibly with an executeCode statement, but this has to be answered by one of the PCM wizards... Link to comment Share on other sites More sharing options...
[Er...] Posted February 18, 2022 Share Posted February 18, 2022 Most likely random enough.. for i = 1 to 10 //Official display("Method 1 -"+list(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).shuffle.first) display("Method 2 -"+mid(millisecondClockValue().asString,12).asInteger) //Unofficial display("Method 3 -"+executeCode("LaggedFibonacciRandom new").seed) next i Link to comment Share on other sites More sharing options...
[He...] Posted February 18, 2022 Share Posted February 18, 2022 Please sign in to view this quote. Look who's doing a guest appearance. Nice to see you here again. What does the ".seed"-thing do? OnT: Depending on how big you want the random number to be. Something like this: //Takes some random parameters that are very hard to predict and makes a string of their numerical hashes LongStringOfNumbers = millisecondClockValue().asString.hash + getPositionCMM().x.asString.hash + getPositionCMM().y.asString.hash+ getPositionCMM().z.asString.hash //converts the long string to a number RandomHighValue = val(LongStringOfNumbers) //If you want a random number between 1 and 100 RandomValueBetween = mod(RandomHighValue,100) +1 There might be some errors in there. I'm not on the Calypso computer right now so I can't test it. The good thing about using the actual position of the CMM is that it is like 6 decimals and it always drifts a little so it becomes extremely hard to predict and even harder to replicate. Link to comment Share on other sites More sharing options...
[To...] Posted February 18, 2022 Share Posted February 18, 2022 Please sign in to view this quote. 🤣 🤣 🤣 Link to comment Share on other sites More sharing options...
[Ch...] Posted February 18, 2022 Share Posted February 18, 2022 Excellent code guys, very funny as well. Random number, you say? Greater than Lower Tol and less than Upper Tol ? Seems fishy ... 🤣 😃 Link to comment Share on other sites More sharing options...
[Er...] Posted February 21, 2022 Share Posted February 21, 2022 Use Result Elements. Result Element1 millisecondClockvalue() Result Element2 millisecondClockvalue() Result Element3 Take the Absolute of Result Element1 - Result Element2 Modify as needed. Link to comment Share on other sites More sharing options...
[Da...] Posted February 22, 2022 Share Posted February 22, 2022 I see, you’re trying to tickle the real precision out of the software… Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in