Guest User

Untitled

a guest
Jul 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. q1 = 'When there is a need to correct someone, I am:
  2. A: afraid to hurt their feelings.
  3. B: quick to do it.' #A = feeling, B = thinking
  4. q2 = 'I consider myself to be:
  5. A: a realist.
  6. B: an idealist.' #A = sensing, B = intuition
  7. q3 = 'Clutter in my home:
  8. A: bothers me.
  9. B: is not something I notice.' #A = judging, B = perceiving
  10. #q4 = 'i tend to:
  11. # A: see the big picture
  12. # B: focus on details' #A = intuition, B = sensing
  13. q5 = 'i would classify myself as:
  14. A: a social butterfly
  15. B: a lone ranger' #A = extroversion, B = introversion
  16.  
  17. $introversion = 0
  18. $extroversion = 0
  19. $intuition = 0
  20. $sensing = 0
  21. $feeling = 0
  22. $thinking = 0
  23. $perceiving = 0
  24. $judging = 0
  25.  
  26. def quizzing (question, type1, type2)
  27. response = ''
  28. puts 'Choose A or B:'
  29. puts
  30. while response != 'a' && response != 'b'
  31. puts "#{question}"
  32. response = gets.chomp.downcase
  33. end
  34. if response == 'a'
  35. return type1
  36. elsif response == 'b'
  37. return type2
  38. end
  39. end
  40.  
  41. def calculate_type (type_match)
  42. if type_match == 'introversion'
  43. $introversion =+ 1
  44. return $introversion
  45. elsif type_match == 'extroversion'
  46. $extroversion =+ 1
  47. return $extroversion
  48. elsif type_match == 'intuition'
  49. $intuition =+ 1
  50. return $intuition
  51. elsif type_match == 'sensing'
  52. $sensing =+ 1
  53. return $sensing
  54. elsif type_match == 'feeling'
  55. $feeling =+ 1
  56. return $feeling
  57. elsif type_match == 'thinking'
  58. $thinking =+ 1
  59. return $thinking
  60. elsif type_match == 'perceiving'
  61. $perceiving =+ 1
  62. return $perceiving
  63. elsif type_match == 'judging'
  64. $judging =+ 1
  65. return $judging
  66. end
  67. end
  68.  
  69. type_match = quizzing(q1, 'feeling', 'thinking')
  70. calculate_type(type_match)
  71. type_match = quizzing(q2, 'sensing', 'intuition')
  72. calculate_type(type_match)
  73. type_match = quizzing(q3, 'judging', 'perceiving')
  74. calculate_type(type_match)
  75. #type_match = quizzing(q4, 'intuition', 'sensing')
  76. #calculate_type(type_match)
  77. type_match = quizzing(q5, 'extroversion', 'introversion')
  78. calculate_type(type_match)
  79.  
  80. #puts $introversion.to_s + 'introversion'
  81. #puts $extroversion.to_s + 'extroversion'
  82. #puts $intuition.to_s + 'intuition'
  83. #puts $sensing.to_s + 'sensing'
  84. #puts $feeling.to_s + 'feeling'
  85. #puts $thinking.to_s + 'thinking'
  86. #puts $perceiving.to_s + 'perceiving'
  87. #puts $judging.to_s + 'judging'
  88.  
  89. world = ''
  90. information = ''
  91. decisions = ''
  92. structure = ''
  93.  
  94. if $introversion > $extroversion
  95. world = 'I'
  96. elsif $introversion < $extroversion
  97. world = 'E'
  98. else
  99. world = 'Both I & E '
  100. end
  101.  
  102. if $intuition > $sensing
  103. information = 'N'
  104. elsif $intuition < $sensing
  105. information = 'S'
  106. else
  107. information = 'Both N & S, '
  108. end
  109.  
  110. if $feeling > $thinking
  111. decisions = 'F'
  112. elsif $feeling < $thinking
  113. decisions = 'T'
  114. else
  115. decisions = 'Both F & T, '
  116. end
  117.  
  118. if $perceiving > $judging
  119. structure = 'P'
  120. elsif $perceiving < $judging
  121. structure = 'J'
  122. else
  123. structure = 'Both P & J '
  124. end
  125.  
  126. puts "Your type is #{world}#{information}#{decisions}#{structure}"
Add Comment
Please, Sign In to add comment