Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright (c) 2012-2015, RaveN Network INC. and/or its affiliates. All rights reserved.
- * RAVEN NETWORK INC. PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- *
- * Licensed Materials - Property of RaveN Network INC.
- * Restricted Rights - Use, duplication or disclosure restricted.
- */
- package net.myproject;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @author lord_rex (Reginald Ravenhorst)
- * @see <a href="https://scontent-vie.xx.fbcdn.net/hphotos-xap1/t31.0-8/11174626_10153436239596840_2843054075889467255_o.jpg">9GAG Image</a>
- */
- public final class PersonalityCalculator
- {
- private static final Map<Integer, String> PERSONALITY_TYPES = new HashMap<>();
- static
- {
- PERSONALITY_TYPES.put(1, "Kind");
- PERSONALITY_TYPES.put(2, "Honest");
- PERSONALITY_TYPES.put(3, "Faithful");
- PERSONALITY_TYPES.put(4, "Caring");
- PERSONALITY_TYPES.put(5, "Passionate");
- PERSONALITY_TYPES.put(6, "Romantic");
- PERSONALITY_TYPES.put(7, "Gentle");
- PERSONALITY_TYPES.put(8, "Reliable");
- PERSONALITY_TYPES.put(9, "Asshole");
- PERSONALITY_TYPES.put(10, "Adventurous");
- PERSONALITY_TYPES.put(11, "Sensitive");
- PERSONALITY_TYPES.put(12, "Protective");
- }
- private static List<Integer> convertToDigits(int i)
- {
- final List<Integer> digits = new ArrayList<>();
- while (i > 0)
- {
- digits.add(0, i % 10);
- i = i / 10;
- }
- return digits;
- }
- /**
- * @param args
- */
- public static void main(String[] args)
- {
- // Pick any number between 1 to 9.
- int selectedNumber = 1; // TODO <--- THIS IS YOUR CHOICE, CHANGE IT!
- if ((selectedNumber < 1) || (selectedNumber > 9))
- {
- throw new UnsupportedOperationException("Between 1 to 9!");
- }
- // Multiply it with 3.
- selectedNumber *= 3;
- // Add 3.
- selectedNumber += 3;
- // Now again multiply it with 3.
- selectedNumber *= 3;
- // You will get 2 digits.
- final List<Integer> digits = convertToDigits(selectedNumber);
- // Now add them.
- selectedNumber = digits.get(0) + digits.get(1);
- // Now this number will tell you what you really are...
- System.out.println("Your personality type is: " + PERSONALITY_TYPES.get(selectedNumber) + ".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement