Game Development Reference
In-Depth Information
'A bunch of totals to track:
Dim daysInJob As Integer = 0
Dim wins As Double = 0.0
Dim losses As Double = 0.0
Dim costs As Double = 0.0
Dim living As Double = 0.0
Dim i As Integer
Fori=1To1000
curJob = Dude.Pick(cash, Occupations)
If curJob.Name < > curJobName Then
'Print results of last job.
Say(name & " spent " & daysInJob.ToString & " with job " & _
curJobName & " ending with $" & Format(cash, "#,##0.00") & _
" from $" & Format(wins, "#,##0.00") & " gains less (" & _
Format(losses, "#,##0.00") & " + " & _
Format(costs, "#,##0.00") & " +"&_
Format(living, "#,##0.00") & _
") in losses+costs+expenses.")
curJobName = curJob.Name
daysInJob = 0
wins = 0.0
losses = 0.0
costs = 0.0
living = 0.0
End If
'Go to work.
daysInJob += 1
'Account the costs.
cash -= curJob.Cost
costs += curJob.Cost
'And take the wages.
wages = curJob.Wages
cash += wages
If wages > 0 Then wins += wages
If wages < 0 Then losses -= wages
Search Nedrilad ::




Custom Search