Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Ask (a subset of) Slashdot: Code Samples

FortKnox (169099) writes | more than 10 years ago

User Journal 18

A gaming company wants me to submit my resume and code samples.A gaming company wants me to submit my resume and code samples.

What code samples should I send??
Demo'ing a pattern? Using something fancy like multithreaded sockets? Something clever I came up with (although nothing clever comes to mind)... I probably shouldn't stall on this, and I don't really have code lying about, so any suggestion I can whip up would be great.

cancel ×

18 comments

Sorry! There are no comments related to the filter you selected.

Examples of 3d Worlds (1)

metlin (258108) | more than 10 years ago | (#9379429)

What position are you applying for, graphics programming?

If so, look through NeHe's OpenGL tutorial [gamedev.net] .

Whip up a nice 3d World highlighting all the cool features (textures, bump-mapping, phong, gouraund and specular reflection, good anti-aliasing, fog, particles, swarm, text and basic movements).

This way, you get to show people that you can code all the cool stuff in graphics.

If it is AI, then you could show a bunch of simple agents and swarms, maybe subjective behaviour and the like (I know that this is what most gaming companies hiring in AI look for). You could also maybe do a bunch of IF stuff (try Inform [inform-fiction.org] , it's a simple and easy language!).

And if it is networking, you could whip up a simple networked game (could be even space invaders!). The idea is to show how well you can handle the various contingencies during games, and how you can effectively counter typical networking problems in the game domain (latency, false positives and negatives, effective prediction of user movement, etc).

Well, I hope that helped! :)

Re:Examples of 3d Worlds (1)

FortKnox (169099) | more than 10 years ago | (#9379556)

Its a networking job. Networked game, eh? I wonder if a simple mud engine would work? Or should I look into using UDP instead of TCP/IP??

Re:Examples of 3d Worlds (1)

subgeek (263292) | more than 10 years ago | (#9379643)

i don't know network code, but i play games online. after configuring my firewall for enough games, i'd say UDP isn't used much anymore. almost everything is using good old tee cee pip.

i'm glad to see you haven't completely given up on the idea.

Re:Examples of 3d Worlds (1)

subgeek (263292) | more than 10 years ago | (#9379705)

can you use google or something to find examples of what other people are showing off in similar circumstances? maybe a bad idea, but you can't deny that it is an idea. a certain bad idea would be copying any of those examples.

Re:Examples of 3d Worlds (1)

linzeal (197905) | more than 10 years ago | (#9379834)

Try Ipv6, that would pry impress them.

Re:Examples of 3d Worlds (1)

metlin (258108) | more than 10 years ago | (#9379976)

I think a simple MUD engine would be a neat idea.

You could write simple implementations using both UDP and TCP/IP, and say why you think one is better than the other. Back in the days of yore, people used to write only using UDP, since they said that the ack took time and therefore TCP/IP is slower. But we're beyond that stage, and since games these days have tonnes of other features and the like, UDP would no longer do. Besides, latency is not as big a problem as it was, say, 10 years ago :)

You should look at Duelling Teapots [scheib.net] -- it's a fault tolerant networked game. Simple, yet elegant.

Maybe you could look at the pseudo-code and work on something similar?

Re:Examples of 3d Worlds (1)

Cyberdyne (104305) | more than 10 years ago | (#9380263)

Its a networking job. Networked game, eh? I wonder if a simple mud engine would work? Or should I look into using UDP instead of TCP/IP??

How about a nicely structured event-driven webserver? That manages to pack in quite a few useful things - JNI, hashtables, parsing, buffer management, I/O and file access, some security awareness - all in a couple of pages.

A simple (recursion only, maybe with caching) DNS server would probably be a good demo of UDP handling, too, without getting too caught up in small details.

Re:Examples of 3d Worlds (1)

Tet (2721) | more than 10 years ago | (#9382304)

How about a nicely structured event-driven webserver? That manages to pack in quite a few useful things - JNI, hashtables, parsing, buffer management, I/O and file access, some security awareness - all in a couple of pages.

Agreed, with a couple of caveats. JNI? This is a gaming company. The concept of writing a game in Java fills me with horror. The mantra for gaming is engine in C, game logic in a scripting language. Java is a poor choice for either. That said, if I was hiring a coder, I'd be looking less at the language used, and more for things like the correct choice of data structure for the problem, and the ability to write efficient yet non-obfuscated code. But obviously code samples in the language likely to be used for the job are always going to be a big win.

My other concern would be about writing it from scratch in a short timeframe. Any non-trivial program will take time to iron out the bugs and get right, and FK has indicated time pressure here. It's a tricky call, though. Certainly all of my best code is owned by the companies I wrote it for, and I don't have the code now (or for the bits I do have, I don't have the right to distribute them).

I'd probably go for a web server in python as the best way to cover all of your bases.

Re:Examples of 3d Worlds (1)

Cyberdyne (104305) | more than 10 years ago | (#9382828)

JNI? This is a gaming company. The concept of writing a game in Java fills me with horror. The mantra for gaming is engine in C, game logic in a scripting language. Java is a poor choice for either.

Good point - I was remembering FK's previous talk about Java, so I assumed he was after Java code samples... I'd be inclined to go for Java over most scripting languages for the logic end, though, especially when it's intended to be multiplayer. Java wouldn't be my first choice of language for very many things, but using a scripting language fills me with much more horror than Java!

I'd probably go for a web server in python as the best way to cover all of your bases.

Yep, also a good bet. (One of the advantages of the JNI part: you get to demonstrate both Java and C/C++ abilities in a single project.)

I actually wrote a webserver as described for my final year dissertation; on reflection, it seems a little "incestuous" - I was writing a Java non-blocking I/O facility at the same time another guy previously from the same lab was writing Sun's own version, while benchmarking it against Zeus, written as the same final year dissertation by two guys from the same lab. Small world...

B2! (1)

(H)elix1 (231155) | more than 10 years ago | (#9379698)

How about a two player battleship game? Give you a chance to show off some graphics toolkits (like OpenGL or DirectX), simple rule/logic checking without making complex AI, and networking if you build two clients that talk to a server... Something that could be done in a weekend if you avoided the hard bits.

Better to ask them what types of code examples they would like to see. Who knows, maybe a simple AD&D character generator in C++ is all they are after - just enough to know you can produce clean, extendable code and comfortably toss pointers about.

From experience (1)

Abm0raz (668337) | more than 10 years ago | (#9379870)

Submit code of what you've done. It doesn't really matter what it is of, but for every snippit you submit, make sure you explain what it does and why you chose it. Something like:
Here is a sample toy I created. All it is is a bouncing ball in gravity. Clicking on it makes it bounce. It shows my use of sprites, user interaction/input capture, graphics, etc ...

That's all they're really looking for, that and your coding technique. Do you code well, follow proper naming conventions, commenting, etc...

-Ab

I'll preface (1)

Zirnike (640152) | more than 10 years ago | (#9379897)

by stating I'm not a coder by profession. I'm mostly a hack (in the 'bad' sense of the word). So take what I say with a grain of salt. I'm also going to be general, instead of saying something like 'how about a networked Tetris clone?'

First, I would send code that is commented well. That could be an important extra positive. Did they ask for a particular language? If not, several code snippets from whatever their primary thing is, plus a couple of other things - for a gaming company, a scripting language (like they might use for AI and 'scene programming' - Python might make a good choice).

Something simple, that displays a range of useful skills, might be good. How about a program that plays poker... Texas hold 'em, say, and one that computes the odds of various hands on the fly given what's showing/in your hand? That could be an interesting problem, and fairly self-contained.

i would say (1)

blinder (153117) | more than 10 years ago | (#9379909)

i would get together your best ding-dang multi-threaded server code you have. One of my "go-to" pieces of code is about 5 years old (some day I'll revamp it) but basically its a chat/IM server I was developing (just to learn) and it came out pretty slick-like and whenever I showed it to anyone, including the last time I was looking for employment, it always scored points.

Plus, the sounds of it, its the most relevant.

If I was an employer (1)

dthable (163749) | more than 10 years ago | (#9380249)

I'd want to see some code that demonstrates that you were faced with a unique problem and found a creative solution. It doesn't matter what the code does. I would just want to know if you can approach the problem differently when needed.

Also, some different programming languages could be a boost. Any programmer worth their paycheck should be capable of handling the same concepts using different languages. Shows you understand the theories behind things instead of remembering an example from some book.

That's a hard one (1)

http (589131) | more than 10 years ago | (#9380266)

I dropped out of a CS program, so take this with however large a grain of salt you feel necessary:
Include somewhere an example of a solution to a near-trivial problem, commented. My favourite is a strobe light with a speedup-on-keypress (and even a debounce subroutine) written in assembler for an 8051 controller; second is a route finder in Prolog, which is a terrible language for imperative-style problems.
This lets them see your style much better than an elegant hack to a hard task, or any working solution to a trivial task.

Right now i'm trying to do exercise 1-21 from K+R's blue C book. Most of my attempts at elegance end with Segmentation fault.

Something already written.... (1)

dmorin (25609) | more than 10 years ago | (#9380661)

It sounds like some people are recommending that you bang something out. I wouldn't. Go with something that you've written. Clean it up if you like. But your odds are better of not doing something stupid by going with something that's already time tested. Especially if time is not on your side.

I vote for something particularly elegant. And I'm deliberately being vague because that means different things to different geeks :). But I think you get my meaning -- there are times to show off how enterprisey you are, and there are times to show off your instinct, creativity and passion.

If you want the job.... (1)

M.C. Hampster (541262) | more than 10 years ago | (#9383491)


...make sure you don't submit any Java code. :-D

A small world (1)

EggDye (41297) | more than 10 years ago | (#9442849)

This journal entry kind of weirded me out (hence the waiting such a long time to add a reply). A game company had asked me to send in a code sample as well, and I was in the middle of coding it when I read this entry. My first thought was, "I'm competing against someone I know on Slashdot for a job". Then you mentioned that it was a networking position, which couldn't possibly be the job I was applying for.

I don't know why it took so long for me to realize this, but it seems like a good demo is the key to breaking into the game industry. From some past JE's, I recall that you are sort of in the same position as me (i.e. trying to wedge your butt through the door of game development). You'll have to make sure to update your JE with the status of your quest when you can.

Anyway, what sort of demo did you end up making? I ended up making a small (I only had a few days to build it from scratch) graphics/GPU programming demo.

Good luck.
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>