What are you playing?

UFOs, lost socks, discuss whatever you like here.

Moderators: Master_Kale, TNM Team

User avatar
Phasmatis
Off Topic Productions
Off Topic Productions
Posts: 2057
Joined: Sun Apr 25, 2004 7:55 am
Location: UK
Contact:

Re: What are you playing?

Post by Phasmatis »

It looks through an array, so if you have an array of 4:

[0]ListOption1
[1]ListOption1
[2]ListOption1
[3]ListOption1

if I = 0 then I = [0]ListOption

I++ adds 1 so I is now [1]ListOption

You use this in a for loop to look through arrays for certain things.

Code: Select all

for(i=0; i < 4; i++)
{
         if(array[i] == array[2]
         {
              // Do what ever you want with ListOption2
         }
}
Keeper of the pointy stick of injustice™.
User avatar
Jaedar
Illuminati
Posts: 3937
Joined: Fri Mar 20, 2009 3:01 pm
Location: Terra, Sweden, Uppsala.

Re: What are you playing?

Post by Jaedar »

DDL wrote:So for instance

i=0;
n=i++;

gives n = 0, i = 1, right? And

i=0;
n=++i;

gives n = 1, i = 1, right?
Think it's the other way around, but yes.

But

i=0;
i++;
n=i;

and

i=0;
++i;
n=i;

both give n = 1, i = 1, right? Because whatever's happening to i has already happened.
Indeed.

A for loop in java however will do the i++ or ++i at the end of the loop anyway(afaik, but I've never tried), so unless you wanted to do the first step twice I really dunno why you would use ++i.


I am coding a simulation for a store with n registers which can either be open or closed depending on how many customers are in line and such.
Last edited by Jaedar on Tue Feb 28, 2012 1:42 pm, edited 1 time in total.
"Delays are temporary; mediocrity is forever."
odio ergo sum
User avatar
Jonas
Off Topic Productions
Off Topic Productions
Posts: 14224
Joined: Sat Apr 24, 2004 9:21 pm
Location: Hafnia

Re: What are you playing?

Post by Jonas »

I'm definitely more of a foreach type of guy, myself.
Jonas Wæver
Chief Poking Manager of TNM

I've made some videogames:
Expeditions: Rome
Expeditions: Viking
Expeditions: Conquistador
Clandestine
AEmer
Illuminati
Posts: 1490
Joined: Fri Jan 26, 2007 12:04 am

Re: What are you playing?

Post by AEmer »

@Lemming

I was part of a 3 man team implementing a java compiler that had all the language features circa 1995 as part of a college course. I don't program often, but I might have a java installation somewhere so I can show you, since you still doubt =P

Alright, found an old eclipse and set up a program that should illustrate it nicely.

Here's the program and the console output:
clicky

Here's the program:

Code: Select all

public class forloops {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("Supsupsup");
		String oldeArray[] = new String[10];
		oldeArray[0] = "one";
		oldeArray[1] = "two";
		oldeArray[2] = "three";
		oldeArray[3] = "four";
		oldeArray[4] = "five";
		oldeArray[5] = "six";
		oldeArray[6] = "seven";
		oldeArray[7] = "eight";
		oldeArray[8] = "nine";
		oldeArray[9] = "ten";
		
		System.out.println(" ");
		
		System.out.println("Testing my method");
		for(int i = 0; i < oldeArray.length; i++){
			System.out.println("oldeArray on spot: " + i + " has the value " + oldeArray[i]);
		}
		System.out.println(" ");
		
		System.out.println("Testing lemmings method");
		for(int i = 0; i < oldeArray.length - 1; i++){
			System.out.println("oldeArray on spot: " + i + " has the value " + oldeArray[i]);
		}
		while (true){}
	}

}
Hope that's to your satisfaction, since apparently my explanation wasn't good enough =P
bobby 55
Illuminati
Posts: 6354
Joined: Wed Jun 24, 2009 9:15 am
Location: Brisbane Australia

Re: What are you playing?

Post by bobby 55 »

Phasmatis wrote:It looks through an array, so if you have an array of 4:

[0]ListOption1
[1]ListOption1
[2]ListOption1
[3]ListOption1

if I = 0 then I = [0]ListOption

I++ adds 1 so I is now [1]ListOption

You use this in a for loop to look through arrays for certain things.

Code: Select all

for(i=0; i < 4; i++)
{
         if(array[i] == array[2]
         {
              // Do what ever you want with ListOption2
         }
}
Cheers. I think I'll stick to playing and leave programming/coding to those who are capable. :)
Growing old is inevitable.......Growing up is optional
User avatar
Jetsetlemming
Illuminati
Posts: 2398
Joined: Mon Sep 18, 2006 9:11 pm
Contact:

Re: What are you playing?

Post by Jetsetlemming »

DDL wrote:JSL & AEmer, is it possible that the behaviour of ++i and i++ varies from language to language? I mean, if JSL is claiming that where you put the plusses affects when in the "for loop" the increment happens, then maybe that's something that is specific to the language he's using? (Coz the internet seems to say there's no difference in loops -the increment happens after a run through the loop either way in java and all C variants..the consensus is that ++i is more efficient, but that compilers take i++ and turn it into ++i anyway)

All the internet says is that n= i++; means that i gets incremented but n is now whatever i was before (i.e. the increment happens after the assignment), whereas n= ++i; means that both n and i are the same value (increment happens before the assignment). In for loops there generally is no assignment within the context of the loop arguments themselves, so I can't see what difference it'd really make.
When you put it that way, actually, I wonder if it's not specifically a feature of C#, but of Visual Studio 2010, which is my programming environment (and I pretty much never want to use anything else ever. Writing Python in notepad++ was painful, and anything I found looking across the internet for a good ide for python with intellisense and spellcheck drove me mad :(). Visual Studio's interpretation of your code certainly is different from the typical vanilla compilers, apparently. Tons of syntax sugar, and handy shortcuts, and automated translation of code for you: for example, when working in WPF, the xaml pages are translated into c# when you compile (and then the c# isn't actually compiled into machine code, but rather the MS intermediate language in the exe. when that's ran, the .NET just-in-time compiler actually compiles it into optimized machine code and runs it).

Also I've been terribly sick the last couple of days so I haven't gotten much done. Tons and tons of reading, and I put in like eight hours so far into the guts of an XNA project (logic for tracking the overall game state, and a stack for screens, and managers for UI elements and classes for some of those elements. I stopped short of the tile rendering engine because focusing on the text was getting hard).

I did however beat the Half-life 1 mod Cry of Fear. It's not bad, in fact it's pretty good for a mod product, but I can't help compare it to its predecessor by the same core people, Afraid of Monsters: Director's Cut. And AoM is a far better product. With Cry of Fear, they distilled the horror, and they let themselves wander stiflingly close to conventional genre tropes as they set out to make a "Survival Horror Game" instead of just a "nightmarish horror mod". You've got a RE style inventory, with six slots, but no magic item box, and occasionally things you drop on the ground with vanish into the ether as an event causes a background area transition to spawn in things or change things, making whatever you dropped for space gone for good.
It's also in general a lot brighter than AoM, with smaller individual maps, less monsters, and overall shorter I think. This is to serve the purpose of adding lots of new shiny to Goldsrc, like water shaders and normal maps and dynamic light sources, but honestly they probably should of just graduated to Source. Strapping these new elements onto this old engine seriously hobbled what they could do with their mod, and the damage done is plainly visible.
Still, overall, a good mod, and a good time, and still very scary. I started a replay with its dev commentary turned on, but found out a couple hours into that that if you save and restart, dev commentary will turn itself off, so if you want to see it all you have to play through in one go- and the game right now, with version 1.0, has a pretty bad memory leak that makes the game crash after roughly two hours of play. :(
Image
AEmer
Illuminati
Posts: 1490
Joined: Fri Jan 26, 2007 12:04 am

Re: What are you playing?

Post by AEmer »

The C# environment could theoretically evaluate differently, but I don't see how, so I recommend you do a little test program like my java program upthere.

Also, I'd recommend using the eclipse plugin pydev for developing python. It's not amazing, but it's quite good.

I'd also add that far and away the best development tool for enterprise code is automated testing. It's tricky to pull off for certain types of software; specifically, software that uses generated code is very hard to black box test...

But when possible, test driven development makes for some of the safest code you can get. When you take upon you both test driven development and the extreme programming methodology, you might not produce code very fast...but mediocre programmers can produce errorfree code that's easy to revise, and while good and great programmers can do that just as a matter of course, the rest of us can't.

If you ever consider switching, I'd recommend you hook yourself up with eclipse in one form or another...unless we're talking about C++ development, in which case I recommend you start popping happy pills ahead of time, so you won't cry yourself to sleep every night.
User avatar
DaveW
New Vision
New Vision
Posts: 2351
Joined: Sat Nov 19, 2005 10:03 am

Re: What are you playing?

Post by DaveW »

Played through Alan Wake on Sunday - I'd given up hope of ever playing it but happened to see it had been released on PC this month. Just goes to show that Remedy have some of the best 3D artists and writers in the game industry. Shame the gameplay was a bit repetitive.
User avatar
Jaedar
Illuminati
Posts: 3937
Joined: Fri Mar 20, 2009 3:01 pm
Location: Terra, Sweden, Uppsala.

Re: What are you playing?

Post by Jaedar »

Tribes ascend.

What do you call a blood raven wot goes really fast and leaves behind lots of glowing red balls?

A hit'n'raider :mrgreen:

horrible jokes aside, the game is really cool. It's basically an fps that deals a lot with movement and large maps. And everyone is armed with explosive weaponry.
"Delays are temporary; mediocrity is forever."
odio ergo sum
AEmer
Illuminati
Posts: 1490
Joined: Fri Jan 26, 2007 12:04 am

Re: What are you playing?

Post by AEmer »

Our team in league of legends is now up to 1200 elo. Quite far to the top, but my god the teamplay in that game. We're now at a level where things are starting to get very interesting. We're always playing in 5 man teams every night now...it's pretty ridiculous, almost to the point where it becomes detrimental, but it's still really fun.
User avatar
Hassat Hunter
Illuminati
Posts: 2182
Joined: Fri Apr 10, 2009 1:20 pm

Re: What are you playing?

Post by Hassat Hunter »

Well, started zombie island. Is level 35. So worked nice with my lvl 36 char. And since monsters where around my level for a change quick leveling.
Result; I am level 38 and there is pretty much no challenge at all AGAIN, since all foes are still stuck at 36/37... *sigh*
Can somebody tell me how I can get a custom avatar?
Oh wait, I already got one...
bobby 55
Illuminati
Posts: 6354
Joined: Wed Jun 24, 2009 9:15 am
Location: Brisbane Australia

Re: What are you playing?

Post by bobby 55 »

Hassat Hunter wrote:Well, started zombie island. Is level 35. So worked nice with my lvl 36 char. And since monsters where around my level for a change quick leveling.
Result; I am level 38 and there is pretty much no challenge at all AGAIN, since all foes are still stuck at 36/37... *sigh*
After playing that and Dead Rising 2, I don't care if I never play a game with Zombies in again. :P

If you breeze through *The Secret Armory of General Knoxx I'll declare you the Baron of Borderlands. ;)

*At level 50 or above.
Growing old is inevitable.......Growing up is optional
User avatar
Hassat Hunter
Illuminati
Posts: 2182
Joined: Fri Apr 10, 2009 1:20 pm

Re: What are you playing?

Post by Hassat Hunter »

Was just minding my business in Borderlands, power cut. :(
Good thing it quicksaves so often.

Though now I have to start at the begin of the DLC (not even area apparently) map again to continue :/. Meh, later...
Can somebody tell me how I can get a custom avatar?
Oh wait, I already got one...
DDL
Traditional Evil Scientist
Traditional Evil Scientist
Posts: 3791
Joined: Mon Oct 17, 2005 10:03 am

Re: What are you playing?

Post by DDL »

Dr Ned's island is really annoying that way: you have to start right back at the teleport station each time you load it up. As I recall, Claptrap's and Knox's DLCs were the same. Still, Crawmerax farming never got old, so hey.
EER
Illuminati
Posts: 2486
Joined: Sat Oct 22, 2005 7:52 pm
Location: NL

Re: What are you playing?

Post by EER »

I finally got around to hooking the wii up to a television set in the office and getting some play time on Epic Mickey. Let's just say I completely agree with whoever was arguing that the camera sucked. Static cameras for no apparent reason, no precise camera control for the player, come on games industry, we've seen better.

I like the artistic style of the game though, but not the wii controls (the whole concept of waving your arms is just stupid) or the intrusive tutorial (this might get less annoying when I progress in the game). I will continue to play, but mainly because I want to like it, maybe it will grow on me.
Another Visitor ... Stay a while ... Stay forever!
Post Reply