She made a Tetris game on Java. :xKogorou wrote: @redangelran
What did you do?
Let's get programmy!
-
- I love sarcasm
Posts: 145- Contact:
Re: Let's get programmy!
- Kogorou
- *drinking beer and playing guitar*
Posts: 1132- Contact:
Re: Let's get programmy!
That's nicemonsi wrote:She made a Tetris game on Java. :xKogorou wrote: @redangelran
What did you do?

Let me see.
-
- Community Villain
Posts: 3588
Re: Let's get programmy!
I did pretty mediocre in my opinion on an interview I just had w LinkedIn.
I might audit/brush up on my data structures.
I might audit/brush up on my data structures.

-
- Community Hero
Posts: 4200
Re: Let's get programmy!
structures you will end up using at your actual job:ranger wrote: I did pretty mediocre in my opinion on an interview I just had w LinkedIn.
I might audit/brush up on my data structures.
vectors/whatever array wrapper your language of choice uses
sets/maps
structures they will ask you about at your interview:
all the others
-
- Community Villain
Posts: 3588
Re: Let's get programmy!
Yeah, had trouble with a hashset implementation for a problem..oh well, I guess I'll see if I'll make it to the 2nd round.Akonyl wrote:structures you will end up using at your actual job:ranger wrote: I did pretty mediocre in my opinion on an interview I just had w LinkedIn.
I might audit/brush up on my data structures.
vectors/whatever array wrapper your language of choice uses
sets/maps
structures they will ask you about at your interview:
all the others
However I did make it to the 2nd round w Salesforce. aw yeh.
edit: somehow I made it to second round with LinkedIn. Dafuq? Also, offer from ViaSat.
Last edited by ranger on November 1st, 2012, 4:11 pm, edited 1 time in total.

- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
It''s running 
Not shown: the number of things you can do wrong (not-existing savegame, invalid adding type, entering an invalid command...) 

Spoiler: My game

If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive








This link provides further information.
Callid Conia Pact - Petitions - Archive
-
- Community Villain
Posts: 3588
Re: Let's get programmy!
Looks like you got a basic File I/O set for your game, and I'm guessing a good hub of your logic? But what exactly is the game?
I don't really make a whole lot of games in my sparetime outside of class..I've made Snake in C, checkers in java, and missile command in x86 (god why).
also, SalesForce get.
I don't really make a whole lot of games in my sparetime outside of class..I've made Snake in C, checkers in java, and missile command in x86 (god why).
also, SalesForce get.

- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
Yeah, logic is kinda done, now I only need to write actual actions (which, as I said, will only be compiled at runtime
) to do stuff. And an AI (see below) :x
It's kind of a interpersonal relationship simulator, but a quite crappy one ATM. Basically, you decide an action and can decide whom else you want to participate. The action then checks whether the person you "invited" actually wants to do that stuff (every action has a repulsion level (fun stuff less, tiresome stuff more, icky stuff most), and other factors (relationship, needs) influence that), and if they do, you complete the action together and the relationships are updated accordingly. However, any person you haven't included in your action will do exactly nothing :x
Which is why I want to write an AI to have them do actions on their own, basing on what they want and need. But first I need to get some actions :x
Also, most of the above example is taken from this huge method (which is entirely uncommented, yay
) :x
Who said something about a black box? XD

It's kind of a interpersonal relationship simulator, but a quite crappy one ATM. Basically, you decide an action and can decide whom else you want to participate. The action then checks whether the person you "invited" actually wants to do that stuff (every action has a repulsion level (fun stuff less, tiresome stuff more, icky stuff most), and other factors (relationship, needs) influence that), and if they do, you complete the action together and the relationships are updated accordingly. However, any person you haven't included in your action will do exactly nothing :x
Which is why I want to write an AI to have them do actions on their own, basing on what they want and need. But first I need to get some actions :x
Also, most of the above example is taken from this huge method (which is entirely uncommented, yay

Who said something about a black box? XD
Code: Select all
public static boolean createSelfAction(Person p, ActionType a) {
if (p.todayAct[g.time.time] != null) {
Action old = p.todayAct[g.time.time];
old.group.getOverseer().todayAct[g.time.time] = null;
Person[] oldParts = old.group.getTemp();
for (int i = 0; i 1) {
arg = Integer.parseInt(temp[1]);
} else {
arg = 1;
}
if (a.validLength(arg)) {
result.length = arg;
IO.w(IO.g("action.create.self.completed", a.toString()));
return schedule().add(result);
} else {
IO.w(IO.g("action.create.self.invalidLength", arg + ""));
break evaluation;
}
} else {
IO.w(IO.g("action.create.self.uncompleted"));
break evaluation;
}
}
select = temp[0];
arg = Integer.parseInt(temp[1]);
if (eval(select) == 101) {
toAdd = g.player;
} else {
if (eval(select) == 103) {
toAdd = g.player.acquaintance.active;
} else {
toAdd = acqSearch(select);
}
}
if (toAdd != null) {
switch (arg) {
case 0:
success = result.group.addMale(toAdd);
break;
case 1:
success = result.group.addFemale(toAdd);
break;
case 2:
success = result.group.addNeuter(toAdd);
break;
default:
success = false;
break;
}
if (success) {
IO.w(IO.g("action.create.self.part.success", toAdd.name));
} else {
IO.w(IO.g("action.create.self.part.failure", toAdd.name));
}
}
} catch (NumberFormatException e) {
IO.w(IO.g("error.input.noNumber", temp[0]));
} catch (ArrayIndexOutOfBoundsException e) {
IO.w(IO.g("error.input.paramMissing"));
}
}
}
}
If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive








This link provides further information.
Callid Conia Pact - Petitions - Archive
-
- Community Hero
Posts: 4200
Re: Let's get programmy!
long as this topic's bumped, may as well post a screenshot:
(programmer art go!)
there's a lack of variety, but I'm holding off on detailing generated maps because in the future I might make a transition to isometric anyway (since the game world is technically 3D), in which case I'll want to make houses that open to the right as well, rather than just the bottom. Of course, now that map generation is done, I have to start implementing scripting, which I haven't started at all yet, so my drive is pretty low atm
Spoiler:
there's a lack of variety, but I'm holding off on detailing generated maps because in the future I might make a transition to isometric anyway (since the game world is technically 3D), in which case I'll want to make houses that open to the right as well, rather than just the bottom. Of course, now that map generation is done, I have to start implementing scripting, which I haven't started at all yet, so my drive is pretty low atm

- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
Spoiler:
I mean, even if it somehow failed to recognize the "." in 0.52 as a ".", it should still be an array of length=1, not =0 :x
If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive








This link provides further information.
Callid Conia Pact - Petitions - Archive
-
- Community Hero
Posts: 4200
Re: Let's get programmy!
before thinking a method is broken, you should look up the API and make sure it does what you think it does, which in this case, it doesn't.
go look up the String.split() method in the Java API, it uses regexes, that period doesn't mean what you think it does.
go look up the String.split() method in the Java API, it uses regexes, that period doesn't mean what you think it does.
- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
Even if the period means any character, shouldn't I still get a different result, namely an array of 5 empty Strings? It does work with escaping, though.Akonyl wrote: before thinking a method is broken, you should look up the API and make sure it does what you think it does, which in this case, it doesn't.
go look up the String.split() method in the Java API, it uses regexes, that period doesn't mean what you think it does.
It's still very strange, as that method has been working for quite a while without any errors whatsoever, and I haven't changed it in months o.O
If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive








This link provides further information.
Callid Conia Pact - Petitions - Archive
-
- Community Hero
Posts: 4200
Re: Let's get programmy!
the API also explains that 
split(string) just acts like split(string, 0). The two-argument split behaves differently depending on the numerical argument (the limit). When defined as 0, all trailing empties are thrown out, so when they're all empties, they're all thrown out. Use .split("\\.", -1); to get your empties back.
As for the method working previously without any changes, I highly doubt that nothing changed. Either you forgot about a tweak you made to it, or you were passing in different input that worked with regexes anyway.

split(string) just acts like split(string, 0). The two-argument split behaves differently depending on the numerical argument (the limit). When defined as 0, all trailing empties are thrown out, so when they're all empties, they're all thrown out. Use .split("\\.", -1); to get your empties back.
As for the method working previously without any changes, I highly doubt that nothing changed. Either you forgot about a tweak you made to it, or you were passing in different input that worked with regexes anyway.
- Callid
- Ratio vincit omnia.
Posts: 1433
Re: Let's get programmy!
.split("\\.") works as well 
Nope, I definitely haven't changed that method for quite a while, and it still worked earlier today. My guess is that this is either
a) due to some update which, among other things, changed the . operator to include numbers, and my IDE didn't recompile either the class the function was in or the other class that called this function until I changed it today or
b) it was because of some difference between Java 1.6 and 1.7 which suddenly became important when I called 1.7-compiled stuff from a 1.6-compiled class (though I thought that class would also be 1.7-compiled o.O)
But I definitely didn't change that method today, and I have been calling it with similar parameters all the time.

Nope, I definitely haven't changed that method for quite a while, and it still worked earlier today. My guess is that this is either
a) due to some update which, among other things, changed the . operator to include numbers, and my IDE didn't recompile either the class the function was in or the other class that called this function until I changed it today or
b) it was because of some difference between Java 1.6 and 1.7 which suddenly became important when I called 1.7-compiled stuff from a 1.6-compiled class (though I thought that class would also be 1.7-compiled o.O)
But I definitely didn't change that method today, and I have been calling it with similar parameters all the time.
If
,
,
,
,
,
,
or
are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive








This link provides further information.
Callid Conia Pact - Petitions - Archive
-
- Community Hero
Posts: 4200
Re: Let's get programmy!
of course it works, but only because "5.23" doesn't result in any trailing empties when you split on the period. I was using that as an example of invoking the method to get trailing empties back (since you were wondering why no empties were returned), and when you call it on "5.23", of course there aren't any trailing empties.