1. ## Re: I can't figure it out.

Originally Posted by yereverluvinuncleber
ok. I'll do better.

2. ## Re: I can't figure it out.

Originally Posted by OptionBase1
Post _ALL_ the code and maybe we can find it.
I'm on the verge of something huge that I plan to market - photorealistic sound. I'm not giving that away.

3. ## Re: I can't figure it out.

Originally Posted by cafeenman
I'm on the verge of something huge that I plan to market - photorealistic sound. I'm not giving that away.
What is the ratio of McGuffins to Hertz? Is it the same as the ratio of leprechauns to unicorns?

4. ## Re: Is RND biased?

OK, this may give away the game, but you have to calculate hertz/pounds for the torque collector then divide that by the screen aspect ratio which is modified by the wing-loading.

It's basic math but putting it together right takes a lot or r & d.

5. ## Re: Is RND biased?

Originally Posted by cafeenman
OK, this may give away the game, but you have to calculate hertz/pounds for the torque collector then divide that by the screen aspect ratio which is modified by the wing-loading.
You can do that all you want, but it ain't gonna fly. You gotta go metric to make it work - and it's hertz/km you need for the torque collector, other wise you're just spinning your wheels.

-tg

6. ## Re: Is RND biased?

As I said, I'm on the verge of something really big that will turn all conventional thought upside down. I left out the real ingredient - the mean hydrodynamic chord.

Now I've just destroyed my entire future by giving away the secret.

I hope my cats forgive me.

7. ## Re: Is RND biased?

Being serious for a minute, this is an example of a sub that I believe is totally even that differs slightly from the others. This is one of those coin-flip subs I mentioned earlier (the nonsense discussion above reminded me of the discoencabulator).

Code:
```Private Sub ReturnToHomeBase()
Dim m_CallStacker As New cCallStacker
Static nReturnToBase(1 To 3) As Long
Dim nRnd As Long

nRnd = RollDie(d3)

nReturnToBase(nRnd) = nReturnToBase(nRnd) + 1

Select Case nRnd

Case 1

Case 2

Case 3

AddPlayerMessage vbCrLf & vbTab & "Your whole family danced together and had the time of their lives.", 1000

AddPlayerMessage vbCrLf & vbTab & "... until Grandma broke her hip.", 2000

End Select

ShowChoiceCount "nReturnToBase", nReturnToBase

End Sub```

8. ## Re: Is RND biased?

Code:
```' Declarations

Public Enum PLAYER_ATTRIBUTES

idx_Player_Attribute_Braintrust = 0      ' B - Braintrust (Formerly Tech Savvy)
idx_Player_Attribute_IntestinalFortitude ' I - Intestinal Fortitude
idx_Player_Attribute_Cheer               ' C - Cheer (Formerly Joy Sparks)
idx_Player_Attribute_Karma               ' K - Karma (Formerly Fate)

idx_Player_Attribute_Energy              ' E - Energy (Formerly Health Points)

End Enum

Public Const MIN_PLAYER_ATTRIBUTE As Long = idx_Player_Attribute_Braintrust
Public Const MAX_PLAYER_ATTRIBUTE As Long = idx_Player_Attribute_Advancements

Public Function RandomAttributeID() As PLAYER_ATTRIBUTES
Dim m_CallStacker As New cCallStacker

RandomAttributeID = RollDie(MAX_PLAYER_ATTRIBUTE + 1) - 1

End Function```

9. ## Re: Is RND biased?

Originally Posted by cafeenman
As I said, I'm on the verge of something really big that will turn all conventional thought upside down.
Doing that would turn some people right side up.

10. ## Re: Is RND biased?

You mentioned in one of your posts in one of your thread that would like to resume a session from a fixed starting point the Rnd value list.
I created a small sample which is capable of doing this:

Code in a module:
Code:
```Option Explicit

Private m_lCalls As Long
Private m_lSeed As Long

Public Sub RNDInit(ByVal lSeed As Long)
m_lCalls = 0
m_lSeed = lSeed
If m_lSeed = 0 Then m_lSeed = 100 * Timer
Rnd -1
Randomize Abs(m_lSeed)
End Sub

' generates a random value between min and max
Public Function RNDVal(ByVal lMin As Long, ByVal lMax As Long, Optional ByVal lIteration As Long = -1) As Long
Dim i As Long

If lIteration <> -1 Then
RNDInit m_lSeed
For i = 1 To lIteration - 1: Rnd: Next
m_lCalls = lIteration - 1
End If

RNDVal = Int((lMax - lMin + 1) * Rnd + lMin)
m_lCalls = m_lCalls + 1
End Function```
To test in a Form with 2 command buttons:
Code:
```Option Explicit

RNDInit 12345
End Sub

Private Sub Command1_Click()
Debug.Print RNDVal(0, 255)
End Sub

Private Sub Command2_Click()
Debug.Print "Item 4", RNDVal(0, 255, 4)
End Sub```

11. ## Re: Is RND biased?

Current state of the game. I have a new monitor (old one got a lot of burn-in and was drawing a ton of amps) so have to reboot. I wanted a screenshot before I ended the app.

Numbers are pretty good regarding distribution. I think they're all within spec of being equally, randomly selected.

But the Reputation bar is skewed way positive. It's the Green line right below the stats. It should stay dead center as it is simply a count of Instances, not points.

It has a max of 1000 a min of 0 and it starts at 500.

So one good thing adds one Rep. One bad thing takes away one Rep. It's at-a-glance if the instances are evenly distributed or not.

12. ## Re: Is RND biased?

Originally Posted by Arnoutdv
You mentioned in one of your posts in one of your thread that would like to resume a session from a fixed starting point the Rnd value list.
I created a small sample which is capable of doing this:

Code in a module:
Code:
```Option Explicit

Private m_lCalls As Long
Private m_lSeed As Long

Public Sub RNDInit(ByVal lSeed As Long)
m_lCalls = 0
m_lSeed = lSeed
If m_lSeed = 0 Then m_lSeed = 100 * Timer
Rnd -1
Randomize Abs(m_lSeed)
End Sub

' generates a random value between min and max
Public Function RNDVal(ByVal lMin As Long, ByVal lMax As Long, Optional ByVal lIteration As Long = -1) As Long
Dim i As Long

If lIteration <> -1 Then
RNDInit m_lSeed
For i = 1 To lIteration - 1: Rnd: Next
m_lCalls = lIteration - 1
End If

RNDVal = Int((lMax - lMin + 1) * Rnd + lMin)
m_lCalls = m_lCalls + 1
End Function```
To test in a Form with 2 command buttons:
Code:
```Option Explicit

RNDInit 12345
End Sub

Private Sub Command1_Click()
Debug.Print RNDVal(0, 255)
End Sub

Private Sub Command2_Click()
Debug.Print "Item 4", RNDVal(0, 255, 4)
End Sub```
OK, so I think I misunderstood what you're telling me and I apologize for that.

For your thing to work I would need to save every time I used rnd, right?

I don't think I said that I wanted to save that state of the game (random-wise) though. I don't want to do that. I would like to be able to save the game stats and reload that and the rnd would just get reinitialized.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•