Forcing a certain outcome

John manutd107 at gmail.com
Wed Jun 16 14:37:28 UTC 2010


First, I apologize if I haven't given enough information to solve this
problem. Please let me know if you need more information!

I am trying to force an outcome in this game I've designed, but only
for the very first trial.

Basically I have the program randomly choose a number 0-99 and for
that to decide the outcome, but for the first trial I want to make
sure that the initial choice and then outcome is always the same. I
have created some code that usually leads to the outcome I want, but
1/10 times it seems to not work.

More specifically, sometimes both the "actor" and "participant" are
gaining points, which I don't want. Instead, I want the "actor" to
always gain points and the "participant" to always lose points, but
just for the very first trial. After that, I want to use the code I've
created to determine the subsequent decisions.

My failed solution: instead of allowing the computer to randomly
generate a number, I tried to force it to use 0, but only for the
first trial. This doesn't seem to work in about 1/10 times for some
reason.

So in an initial InLine object I state:

FirstTrial = true

Then in the Procedure I have:

If FirstTrial Then
c.SetAttrib "ActorValue", "50/50"
c.SetAttrib "PartValue", "Bad"
took = true
End If

Then in the general User script I have:

Dim FirstTrial as Boolean
'Calculates how much someone's points will change if they took
Function PointMod(Value as String, FirstTrial as Boolean) as Integer
Randomize
Dim percent as Integer
percent = Random(0, 99)
If FirstTrial Then
	percent = 0
End If
Select Case Value
	Case "Good"
		If percent < 85 Then
			pointMod = 10
		Else
			pointMod = -10
		End If
	Case "Bad"
		If percent < 85 Then
			pointMod = -10
		Else
			pointMod = 10
		End If
	Case "50/50"
		If percent < 50 Then
			pointMod = 10
		Else
			pointMod = -10
		End If
End Select
End Function

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list