|
| 23 Jun 2016 09:21 PM |
| How do I select the number generated by math.random in the script and make it -30 is it possible? |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 09:25 PM |
| And set the number generated as a variable like a = number |
|
|
| Report Abuse |
|
|
jody7777
|
  |
| Joined: 22 Feb 2009 |
| Total Posts: 1343 |
|
|
| 23 Jun 2016 09:26 PM |
multiplication
FOR THE CAUSE |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2016 09:30 PM |
| Please be a little bit more specific |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 23 Jun 2016 09:31 PM |
| Is it really a random number if you're selecting it? |
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 23 Jun 2016 09:36 PM |
-30 / math.random()
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
| |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 23 Jun 2016 10:00 PM |
wtf are you talking about
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 23 Jun 2016 10:10 PM |
ohh like
a = math.random(1, 100) - 30
??? |
|
|
| Report Abuse |
|
|
intel
|
  |
| Joined: 09 May 2008 |
| Total Posts: 32 |
|
| |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 24 Jun 2016 12:32 PM |
I thought he meant manipulating the number returned by math.random() to turn it into -30 (multiplication)
Formerly ToxicDominator - add 17,509 posts | :(){:|:&};: |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Jun 2016 08:07 PM |
local options = {1,-1} local other = {}
local result = (other[math.random(1,#other)] * options[math.random(1,#options)]) |
|
|
| Report Abuse |
|
|
adoman
|
  |
| Joined: 01 Sep 2010 |
| Total Posts: 306 |
|
|
| 24 Jun 2016 08:12 PM |
local num1 = 2 local num2 = 40000
local myNum = math.random(num1, num2) myNum = -30 |
|
|
| Report Abuse |
|
|
Luckify
|
  |
| Joined: 11 Aug 2012 |
| Total Posts: 701 |
|
| |
|
|
| 24 Jun 2016 09:37 PM |
local math1 = 30 local math2 = 60 local subtractThirty = false
local randomMath = math.random(math1, math2) if subtractThirty == true then local endMath = randomMath - 30 print(endMath) else endMath = randomMath print(endMath) end
--I can put my waits wherever I want!
|
|
|
| Report Abuse |
|
|
|
| 24 Jun 2016 09:39 PM |
num = math.random(1,100) num - 30 |
|
|
| Report Abuse |
|
|
jody7777
|
  |
| Joined: 22 Feb 2009 |
| Total Posts: 1343 |
|
|
| 24 Jun 2016 11:44 PM |
maxRecursionDepth = maxRecursionDepth or 10 local eps = calculus.doubleEpsilon if torch.typename(a) == 'torch.FloatTensor' then eps = calculus.floatEpsilon end local c = (a+b)/2 local h = b - a local fa = f(a) local fb = f(b) local fc = f(c) local S = (h/6) * (fa + 4*fc + fb) return aSimpsonsRecursion(f, a, b, eps, S, fa, fb, fc, maxRecursionDepth)
FOR THE CAUSE |
|
|
| Report Abuse |
|
|
| |
|