• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
melloorr

Am I Ready?

43 posts in this topic

I have been reading through a book on C# and i was wondering if you think i am ready to start writing extremely basic programs. I have been doing the examples in the book and trying not to move on in the book untill i am reasonably comfortable with what i have just read. (Also, this may sound like a noob question, but what programs should i start off with?)

Thank you :)
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312247109' post='4843381']
I have been reading through a book on C# and i was wondering if you think i am ready to start writing extremely basic programs.[/quote]
Yes. Give it a try!
0

Share this post


Link to post
Share on other sites
A cool idea would also be a simple text andventure. Using files to drive the game instead of hardcoding it. That should keep you busy.
0

Share this post


Link to post
Share on other sites
A text based calculator might work pretty well. You learn how to handle inputs pretty well from it in my opinion and you can do it very early on while learning to program.
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312247109' post='4843381']I have been reading through a book on C# and i was wondering if you think i am ready to start writing extremely basic programs. I have been doing the examples in the book and trying not to move on in the book untill i am reasonably comfortable with what i have just read. (Also, this may sound like a noob question, but what programs should i start off with?)[/quote]
Ready are you, young Jedi! You could start with a text-based Higher or Lower card game. This would involve making both a data structure to represent a single card and one for representing a deck (which would manage 52 card structures), being able to represent each of them on the screen (for example "9C" for "9 of clubs"), and compare them to find out which has the higher value -- all in all a good, little beginner's project that will teach you some basic principals of game programming.
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312247109' post='4843381']
I have been reading through a book on C# and i was wondering if you think i am ready to start writing extremely basic programs. I have been doing the examples in the book and trying not to move on in the book untill i am reasonably comfortable with what i have just read. (Also, this may sound like a noob question, but what programs should i start off with?)

Thank you :)
[/quote]

Dude you don't realy learn from reading you learn from writing the code.. Just give it a try!
Myself when i started learning java i tried to make my own swing applications and i had great fun with it also and it helped me learn alot!
So realy my advice is just go for the console applications if you never realy coded before.
0

Share this post


Link to post
Share on other sites
Another good exercise is to read in your own source file and output the comments in the file only and replace all the rest with spaces. This learns you somthing about state machines and file parsing, remeber that C# has // and /**/ as comment syntax.
0

Share this post


Link to post
Share on other sites
Never underestimate the educational value of Pong. Don't even worry about graphics yet, just learn how to clear the screen quickly, and redraw the paddle and ball with ascii characters.

As you learn new things like graphics, sound, or networking, you can add them to your Pong game... you can basically start at zero and (if you stick with it) incrementally improve things until you have a professional-looking game. Sticking with one game and improving it over time will also teach you a lot about code re-use, which plenty coders don't really grasp until they've been writing code for a year or two.
0

Share this post


Link to post
Share on other sites
Thanks for all your suggestions, i will try to attempt them all! :)

[quote name='laztrezort' timestamp='1312249203' post='4843390']

Depends on what you've learned so far. Off the top of my head:

Some very basic string manipulation, to practice input/output, loops, and a few standard library methods:

1. Ask for a name, user enters a name, output the the name in all capital letters
2. As above, except output each letter separately then pause until the user hits the enter key
3. As above, but output the letters backwards, or in alphabetical order, or shuffle them randomly
4. Create a simple database, where the user enters names and phone numbers. If the user hits enter without entering a name, ask for a name, and then output the associated phone number previously entered
5. As above, but save the name/number data to a text file.

A simple game might be a guess-the number, where after each guess the program outputs "higher" or "lower" until the user guesses correctly (or only give the user a fixed # of guesses before loosing).
[/quote]

I am having trouble with #2, I dont know how to do it, i have tried looking but i have found nothing yet :blink: Can anyone give me a hint on how i could do it please?
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312298914' post='4843632']
[quote name='laztrezort' timestamp='1312249203' post='4843390']
2. As above, except output each letter separately then pause until the user hits the enter key
[/quote]
I am having trouble with #2, I dont know how to do it, i have tried looking but i have found nothing yet :blink: Can anyone give me a hint on how i could do it please?
[/quote]

Hint: You can use a string like an array of chars.
0

Share this post


Link to post
Share on other sites
[quote name='Nypyren' timestamp='1312304840' post='4843661']
Hint: You can use a string like an array of chars.
[/quote]

Am i being stupid? I still can't do it :( All i can find is how to split string that have commas in, but none about splitting a word
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312309820' post='4843697']Am i being stupid? I still can't do it :( All i can find is how to split string that have commas in, but none about splitting a word[/quote]
No, you are not stupid; programming can be very difficult in the beginning when you are unfamiliar with even the most basic principals. If you list your program so far I may be able to give you a few guideline =)
0

Share this post


Link to post
Share on other sites
[quote name='Dragonion' timestamp='1312311748' post='4843715']
[quote name='melloorr' timestamp='1312309820' post='4843697']Am i being stupid? I still can't do it :( All i can find is how to split string that have commas in, but none about splitting a word[/quote]
No, you are not stupid; programming can be very difficult in the beginning when you are unfamiliar with even the most basic principals. If you list your program so far I may be able to give you a few guideline =)
[/quote]

This is what i have got for # 1 and 3:
[code]
using System;

class BasicProject1
{
static void Main()
{
string name, nameUp, nameBack;

Console.Write("Please enter your name: ");
name = Console.ReadLine();

nameUp = name;
nameUp = nameUp.ToUpper();
nameBack = name;

Console.WriteLine("Your name in capitals is: " + nameUp);

Console.Write("Your name backwards is: ");

for (int i = 0; i < nameBack.Length; i++)
{
Console.Write(nameBack[nameBack.Length -i - 1]);
}

Console.ReadLine();
}
}
[/code]
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312315360' post='4843744']This is what i have got for # 1 and 3:[/quote]
[code]using System;

class BasicProject1
{
static void Main()
{
string name, nameUp, nameBack;

Console.Write("Please enter your name: ");

name = Console.ReadLine();
nameUp = name.ToUpper(); // string.ToUpper returns a copy of the string so I merged the two lines
nameBack = name;

Console.WriteLine("Your name in capitals is: " + nameUp); // Good! Task #1 complete :)

// I am not going to solve #2 for you, but here is a tip:
// Console::ReadKey(Boolean) will read the next keystroke by the user, including function keys,
// and if you set the Boolean value to "true" it will not output the read character on the screen.

Console.Write("Your name backwards is: ");

// When you are dealing with strings (that fall into the category "things that may change at run-time")
// it is usually a good idea to assign its length to a local variable when accessing each character in turn
// before you start the for-loop like this:
//
// int i,n=nameBack.Length;
//
// for(i=0;i<n;i++)
// {
// ...
// }

for (int i = 0; i < nameBack.Length; i++)
{
Console.Write(nameBack[nameBack.Length -i - 1]);
}

Console.ReadLine();
}
}
[/code]
1

Share this post


Link to post
Share on other sites
Another hint for #2: Watch what happens in your loop that prints the name backwards. Put a breakpoint inside the loop and watch your output each time you step through the loop. It prints out one letter at a time, right? You should be able to add something else inside the loop which makes it wait in a similar way to the breakpoint (previous people have hinted how to do this).
1

Share this post


Link to post
Share on other sites
[quote name='Nypyren' timestamp='1312332426' post='4843858']
Another hint for #2: Watch what happens in your loop that prints the name backwards. Put a breakpoint inside the loop and watch your output each time you step through the loop. It prints out one letter at a time, right? You should be able to add something else inside the loop which makes it wait in a similar way to the breakpoint (previous people have hinted how to do this).
[/quote]

Thanks! I finally done it! Well im pretty sure i have :)

[code]using System;

class BasicProject1
{
static void Main()
{
string name, nameUp, nameBack;

// Task One

Console.Write("Please enter your name: ");
name = Console.ReadLine();

nameUp = name.ToUpper();
nameBack = name;

Console.WriteLine("Your name in capitals is: " + nameUp);

// Task Two

int s = name.Length;

for (int i = 0; i < s; i++)
{
Console.Write(name[i]);
Console.ReadKey(true);
continue;
}

// Task Three

Console.Write("\nYour name backwards is: ");

int n = nameBack.Length;

for (int i = 0; i < n; i++)
{
Console.Write(nameBack[nameBack.Length -i -1]);
}

Console.ReadLine();
}
}[/code]
0

Share this post


Link to post
Share on other sites
[quote name='melloorr' timestamp='1312334050' post='4843871']Thanks! I finally done it! Well im pretty sure i have :)[/quote]
Woohoo! Good job! =)

A couple of things:

1.[code]
for (int i = 0; i < s; i++)
{
Console.Write(name[i]);
Console.ReadKey(true);
continue; // this is redundant
}
[/code]
When the keyword [font="Courier New"]continue[/font] is encountered the program will execute the 'update statement' in the for-loop (in this case [font="Courier New"]'i++'[/font]) and jump to the beginning of the loop. In effect, the code below the continue statement will be skipped. In your case, however, there [i]is[/i] no code below the continue statement which makes it redundant. Typically you use a continue statement when you do not want to process certain elements in a list/array:

[code]
for (int i = 0; i < s; i++)
{
if(Objects[i].paintMe==false)
continue;

PaintObject(Objects[i]);
}
[/code]

2.[code]
int n = nameBack.Length;

for (int i = 0; i < n; i++)
{
Console.Write(nameBack[nameBack.Length -i -1]);
}
[/code]
The idea of saving the length of the string at the beginning is to ensure you are always referencing the original length. Also, when you only have a single statement in your loop you don't need the curly brackets:

[code]
int n = nameBack.Length;

for (int i = 0; i < n; i++)
Console.Write(nameBack[n-i-1]); // notice that we are now using 'n' instead of 'nameBack.Length'
[/code]
.. or, if you want to be really hardcore:

[code]
int n = nameBack.Length-1;

for(;n>=0;n--)
Console.Write(nameBack[n]);
[/code]
0

Share this post


Link to post
Share on other sites
I knew there would be things i didnt need, but i was just glad that i did it! :)

I have now done all those tasks (but i was unsure about the basic database, here is what I got though).

It may be a little rough around the edges but it does the job:

[code]using System;
using System.IO;

class BasicProject1
{

static void Main()
{
string name, nameUp, nameBack, namePerson, nameNumber;
int n;


// Task One

Console.Write("Please enter your name: ");
name = Console.ReadLine();

nameUp = name.ToUpper();
nameBack = name;

Console.WriteLine("\nYour name in capitals is: " + nameUp);

// Task Two

int s = name.Length;

for (int i = 0; i < s; i++)
{
Console.Write(name[i]);
Console.ReadKey(true);
}

// Task Three

Console.Write("\n\nYour name backwards is: ");

int b = nameBack.Length;

for (int i = 0; i < b; i++)
Console.Write(nameBack[b - i - 1]);

// Task Four

do
{
Console.Write("\nEnter your Name: ");
namePerson = Console.ReadLine();
} while (namePerson == "");

do
{
Console.Write("\nEnter your Number: ");
nameNumber = Console.ReadLine();
n = nameNumber.Length;
} while (n != 11);

Console.WriteLine("\nThe phone number you entered is: " + nameNumber);

// Task Five

StreamWriter writer;
writer = new StreamWriter(namePerson + ".txt");
writer.WriteLine("Your Name is: " + namePerson);
writer.WriteLine("Your phone number is: " + nameNumber);
writer.Close();

Console.WriteLine("\nYour info has now been saved to a file.");

Console.ReadLine();
}
}[/code]
0

Share this post


Link to post
Share on other sites
Next, Have the program ask a question like "How is the weather today? [Good, Bad, Fair, The Sun Just Exploded]" and have the program respond in different ways based on one of those 4 conditions.

Ex)
How is the weather today?> Good
Im glad the weather is Good today.

How is the weather today?> Bad
Im sorry the weather is Bad today.

How is the weathe today?> The Sun Just Exploded
Oh my, well, it was nice knowing you.



0

Share this post


Link to post
Share on other sites
[quote name='Net Gnome' timestamp='1312389366' post='4844120']
Next, Have the program ask a question like "How is the weather today? [Good, Bad, Fair, The Sun Just Exploded]" and have the program respond in different ways based on one of those 4 conditions.

Ex)
How is the weather today?> Good
Im glad the weather is Good today.

How is the weather today?> Bad
Im sorry the weather is Bad today.

How is the weathe today?> The Sun Just Exploded
Oh my, well, it was nice knowing you.

[/quote]

Thanks :) Heres the code for that:
[code]using System;
using System.IO;

class BasicProject1
{

static void Main()
{
string name, nameUp, nameBack, namePerson, nameNumber;
int n;


// Task One

Console.Write("Please enter your name: ");
name = Console.ReadLine();

nameUp = name.ToUpper();
nameBack = name;

Console.WriteLine("\nYour name in capitals is: " + nameUp);

// Task Two

int s = name.Length;

for (int i = 0; i < s; i++)
{
Console.Write(name[i]);
Console.ReadKey(true);
}

// Task Three

Console.Write("\n\nYour name backwards is: ");

int b = nameBack.Length;

for (int i = 0; i < b; i++)
Console.Write(nameBack[b - i - 1]);

// Task Four

do
{
Console.Write("\nEnter your Name: ");
namePerson = Console.ReadLine();
} while (namePerson == "");

do
{
Console.Write("\nEnter your Number: ");
nameNumber = Console.ReadLine();
n = nameNumber.Length;
} while (n != 11);

Console.WriteLine("\nThe phone number you entered is: " + nameNumber);

// Task Five

StreamWriter writer;
writer = new StreamWriter(namePerson + ".txt");
writer.WriteLine("Your Name is: " + namePerson);
writer.WriteLine("Your phone number is: " + nameNumber);
writer.Close();

Console.WriteLine("\nYour info has now been saved to a file.");

// Extra Task

Console.WriteLine("\nHow is the weather today?");
Console.WriteLine("(g = Good, b = Bad, f = Fair, d = The Sun Has Just Exploded AKA Death)");
string weather = Console.ReadLine();

switch (weather)
{
case "g":
Console.WriteLine("I am glad the weather is Good today!");
break;

case "b":
Console.WriteLine("I am sorry the weather is Bad today");
break;

case "f":
Console.WriteLine("It could be worse!");
break;

case "d":
Console.WriteLine("Oh my, well it was nice knowing you.");
break;

default:
Console.WriteLine("Please enter a valid answer!");
break;
}

Console.ReadLine();
}
}[/code]
0

Share this post


Link to post
Share on other sites
Good job. Lets try some Mathematics processing. Try finding all the prime numbers between 1 to 1000 have them print to the console on their own lines.
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0