So I'm pretty much James Bond.
String[]effects={"range","duration","attack","defence"};String[]jrange={"tori","inu","nezumi"};String[]jdef={"hebi","ii"};String[]jatk={"tora","uma","saru"};String[]jtime={"ushi","tatsu","u"};ArrayList<HashSet<String>>sets=new ArrayList<HashSet<String>>();sets.add(new HashSet<String>(Arrays.asList(jrange)));sets.add(new HashSet<String>(Arrays.asList(jtime)));sets.add(new HashSet<String>(Arrays.asList(jatk)));sets.add(new HashSet<String>(Arrays.asList(jdef)));HashMap<String,HashSet<String>>map=new HashMap<String,HashSet<String>>();for(int i=0;i<effects.length;i++){map.put(effects[i],sets.get(i));}
ArrayList>sets=new ArrayList>(new HashSet[]{new HashSet(Arrays.asList(jrange)),new HashSet(Arrays.asList(jtime)),new HashSet(Arrays.asList(jatk)),new HashSet(Arrays.asList(jdef))});
I didn't think such thing as a java enthusiast existed.
Programming personality type No. 9: The True BelieverDid you know that the best way to run Ruby is with Java? The Java devotees will tell you this in case you're thinking. The C lovers know that it would run faster than a Ferrari if someone would rewrite it in C because that's the only way to "get close to the metal."It usually seems moderately funny to set up a lunch with a Python lover and C devotee and watch them snipe at each other for an hour.Car: Anything with a sticker showing Calvin peeing on the competitionRelationship status: Married to the one who should have led the homecoming paradeHousehold chore: Putting up flags for holidaysRole model: Richard Stallman or Steve Jobs or ....Pet: "He won 'Best in Show' in 2009 and 2010."Favorite programming construct: Sit down first and askDrink: It's tattooed on their arm
The \n function in Java no longer works as a universal new line character.Use one of the following:String.format("%n")System.getProperty("line.separator")System.getProperty is universalThank you
Quote from Tiwaking!: September 26, 2014, 11:20:55 pmThe \n function in Java no longer works as a universal new line character.Thank youWhat an awful change... That's going to require massive change. And surely they could've at least made getting the new character easier. Say.... Environment.NewLine
The \n function in Java no longer works as a universal new line character.Thank you
Absolute monarchy\nA form of government where the monarch rules unhindered, i.e., without any laws, constitution, or legally organized oposition.
Absolute monarchyA form of government where the monarch rules unhindered, i.e., without any laws, constitution, or legally organized oposition.
Quote from Xenolightning: September 27, 2014, 02:47:21 pmQuote from Tiwaking!: September 26, 2014, 11:20:55 pmThe \n function in Java no longer works as a universal new line character.Thank youWhat an awful change... That's going to require massive change. And surely they could've at least made getting the new character easier. Say.... Environment.NewLineThe \n function works, it just does not seem to work when you try saving to a text file.I have no idea why. For example:Code: [Select]Absolute monarchy\nA form of government where the monarch rules unhindered, i.e., without any laws, constitution, or legally organized oposition.Is being saved asCode: [Select]Absolute monarchyA form of government where the monarch rules unhindered, i.e., without any laws, constitution, or legally organized oposition.This is happens when you use the file writer e.gfileWriter.write("Absolute monarchy\nA form of government where the monarch rules unhindered, i.e., without any laws, constitution, or legally organized oposition.");
You probably need to escape it somehow?
Quote from Lias: September 30, 2014, 06:45:44 pmYou probably need to escape it somehow?The backslash is escaping it. '\n' is a line feed, or more commonly "new line"The whole thing looks like a bit of balls up. Back when I did Java \n worked fine for files. I used \r\n for "safety", but meh.Out of interest what OS were you on? Should also try running the same code against an older VM see when they "broke" it.Also Tiwa, this is why you should most definitely move to C# :P
The backslash is escaping it. '\n' is a line feed, or more commonly "new line"
What I mean is that the \n is clearly being discarded/ignore by the filewriter.write. If the output Tiwa posted is accurate,it's not processing it, or passing it through, it's simply ignoring it. I don't Java,but that suggests to me that somehow it needs to be escaped an additional degree so that whatever logic in the filewriter.write statement is formatting it, doesn't interpret it and format it.Does that make sense?
Quote from Xenolightning: September 30, 2014, 08:23:06 pmThe backslash is escaping it. '\n' is a line feed, or more commonly "new line"I know what a newline is Xeno.. I was troubleshooting PC's when you were still in your dads ballbag I'm actually old enough to remember using dot matrix and line printers where these sort of things were quite relevant :-PWhat I mean is that the \n is clearly being discarded/ignore by the filewriter.write. If the output Tiwa posted is accurate,it's not processing it, or passing it through, it's simply ignoring it. I don't Java,but that suggests to me that somehow it needs to be escaped an additional degree so that whatever logic in the filewriter.write statement is formatting it, doesn't interpret it and format it.Does that make sense?
I don't Java,but that suggests to me that somehow it needs to be escaped an additional degree so that whatever logic in the filewriter.write statement is formatting it, doesn't interpret it and format it.