Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts 'Hlello world'
- ends = 0
- year = 1
- human = 0
- human2 = 0
- human3 = 0
- humanNumberInt = 0
- humanDeadInt = 0
- family = Hash.new #1:father, 2:mother, 3:son, 4:daughter, 5:brother, 6:sister, 7:uncle, 8:aunt, 9:cousin, 10:grandfather, 11:grandmother, 12:grandson, 13:granddaughter
- personCreated = []
- humanNumber = []
- isMarried = []
- marriedTo = []
- childrenBorn = []
- alive = []
- gender = []
- age = []
- str = []
- agi = []
- int = []
- wis = []
- lastName = []
- firstName = []
- firstNameOptionsMale = ["Bob", "Carl", "Frank", "Joe", "John", "Mike", "Hank", "Louis", "Tim", "Kevin", "Dende", "Andrew", "Dan", "Evan", "Zach", "Steve", "Thomas", "Satan", "Nick", "Jesus"]
- firstNameOptionsFemale = ["Abby", "Claudia", "Bianca", "Gabrielle", "Elissa", "Erin", "Katherine", "Mabel", "Ona", "Rachelle", "Cindi", "Terresa"]
- lastNameOptions = ["Helix", "Obama", "Smith", "Brown", "Johnson", "Lee", "Wilson", "Martin", "Patel", "Taylor", "Wong", "Campbell", "Williams", "Thompson", "Jones", "Miller", "Davis", "Jackson", "White", "Lopez", "Harris", "Clark", "Allen", "Wright", "Baker", "Hill", "Parker"]
- while human < 10 do
- gender[human]=rand(2)+1
- if gender[human] ==1
- firstName[human]=firstNameOptionsMale[rand(firstNameOptionsMale.length)]
- elsif gender[human] ==2
- firstName[human]=firstNameOptionsFemale[rand(firstNameOptionsFemale.length)]
- end
- alive[human]=1
- childrenBorn[human]=1
- isMarried[human]=0
- marriedTo[human]=-1
- age[human]=rand(15)+17
- personCreated[human]=1
- lastName[human]=lastNameOptions[rand(lastNameOptions.length)]
- humanNumber[human]=humanNumberInt
- humanNumberInt+=1
- puts "#{firstName[human] + " " + lastName[human]}"
- puts "gender #{gender[human]}"
- puts "alive #{alive[human]}"
- puts "isMarried #{isMarried[human]}"
- puts "age #{age[human]}"
- puts "humanNumber #{humanNumber[human]}"
- human+=1
- puts " "
- end
- human=0
- while ends < 400 do
- puts "------------------------------\nACCOUNCEMENTS YEAR #{year}\n------------------------------"
- while human<humanNumberInt do
- if alive[human]==1
- age[human]+=1
- #puts age[human]
- end
- human+=1
- end
- human=0
- while human<humanNumberInt do
- if (alive[human]==1 && rand(10000)+1<=(3^(age[human])))
- alive[human]=0
- puts "#{firstName[human]} #{lastName[human]} has died"
- humanDeadInt+=1
- end
- human+=1
- end
- human=0
- while human2<humanNumberInt do
- while human<humanNumberInt do
- if (gender[human] != gender[human2] && isMarried[human] ==0 && isMarried[human2] ==0 && personCreated[human] == 1 && personCreated[human2] == 1 && age[human] >=18 && age[human2]>=18 && alive[human]==1 && alive[human2]==1)
- #puts human
- #puts human2
- marriedTo[human]=humanNumber[human2]
- marriedTo[human2]=humanNumber[human]
- isMarried[human]=1
- isMarried[human2]=1
- #puts firstName[human] + " " + lastName[human] + " and " + firstName[marriedTo[human]] + " " + lastName[marriedTo[human]] + " are now married"
- if (gender[human] == 2)
- # puts firstName[human] + " " + lastName[human] + " is now named " + firstName[human] + " " + lastName[marriedTo[human]]
- lastName[human]=lastName[marriedTo[human]]
- else
- # puts firstName[marriedTo[human]] + " " + lastName[marriedTo[human]] + " is now named " + firstName[marriedTo[human]] + " " + lastName[human]
- lastName[marriedTo[human]]=lastName[human]
- end
- end
- human+=1
- end
- human2+=1
- human=0
- end
- human=0
- human2=0
- while human<humanNumberInt do
- if (isMarried[human] == 1 && marriedTo[human] != -1 && gender[human] == 2 && personCreated[human] ==1 && alive[human] ==1 && alive[marriedTo[human]]==1 && age[human]<64 && age[marriedTo[human]]<64)
- if (rand(childrenBorn[human]*8)+1==(1))
- human2=humanNumberInt
- gender[human2]=rand(2)+1
- if gender[human2] ==1 #boy born
- firstName[human2]=firstNameOptionsMale[rand(firstNameOptionsMale.length)]
- family[[human,human2]]=3 #mother:son
- family[[human,human2]]=3
- family[[human,human2]]=3
- else gender[human2] ==2 #girl born
- firstName[human2]=firstNameOptionsFemale[rand(firstNameOptionsFemale.length)]
- family[[human,human2]]=4 #mother:daughter
- end
- family[[human2,human]]=2 #child:mother
- family[[human2,marriedTo[human]]]=1 #child:father
- lastName[human2]=lastName[human]
- childrenBorn[human2]=1
- alive[human2]=1
- isMarried[human2]=0
- marriedTo[human2]=-1
- age[human2]=0
- personCreated[human2]=1
- humanNumber[human2]=humanNumberInt
- humanNumberInt+=1
- #puts firstName[human] + " " + lastName[human] + " has given birth to " + firstName[human2] + " " + lastName[human2]
- end
- end
- human+=1
- end
- human=0
- human2=0
- year+=1
- ends+=1
- end
- puts "total: #{humanNumberInt}"
- puts "alive: #{humanNumberInt-humanDeadInt}"
- puts "dead: #{humanDeadInt}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement