Is C# retarded, or is it just me???

I'm trying to make my own dungeon crawler RPG console-based game.

Here is my code:
--------------------------------------------------------------------
using System;

namespace mainProject
{
class mainClass
{
public static void Main(string[] args)
{
Random numGen = new Random();
int rand1 = numGen.Next(1, 5);
int rand2 = numGen.Next(1, 5);
int plyPOSX = 2;
int plyPOSY = 2;
string movement;
int item = 8;
int playerHealth = 5;
int width = 5;
int height = 5;
int[,] grid = new int[width,height];

frame:

grid[rand1,rand2] = item;
grid[plyPOSX,plyPOSY] = playerHealth;

for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
Console.Write(grid[x,y] + " ");
}
Console.WriteLine();
}

move:
Console.WriteLine("Use WASD to walk.");
movement = Convert.ToString(Console.ReadKey());

if (movement == "W")
{
plyPOSY = plyPOSY - 1;
goto frame;
}
else if (movement == "S")
{
plyPOSY = plyPOSY + 1;
goto frame;
}
else if (movement == "A")
{
plyPOSX = plyPOSX - 1;
goto frame;
}
else if (movement == "D")
{
plyPOSX = plyPOSX + 1;
goto frame;
}
else
{
goto move;
}
}
}
}
--------------------------------------------------------------------

The problem is that the loop called "frame" does not fucking loop. Help me with this!

Attached: 4.gif (256x256, 80K)

Other urls found in this thread:

robmiles.com/c-yellow-book/
twitter.com/AnonBabble

Loving those closing brackets

>using goto statements for extremely basic control flow
You are the retard here

>goto
Please tell me this is shitty bait

All TAB spaces were removed by Jow Forums. They told me to use the code tag. I'm not sure how to.

You have much to learn.

>goto frame;
>goto frame;
>goto frame;
>goto frame;

Attached: 1492645257219.png (407x446, 27K)

>goto
top kek

is this the new grad thread

>goto

>muh goto boogeyman

Use code tags please

>}
>}
>}
>}

Kill yourself

you literally have no reason to use goto in languages with procedures/functions (unless you need to jump between cases in switch statements)

>You may highlight syntax and preserve whitespace by using tags.

READ THE FAQ.

>all this indentation level JUST to have a main

so.. THIS is the power.. of C++++

namespace mainProject
{
class mainClass
{
public static void Main(string[] args)
{
/* code here*/

Oh fuck off. goto has legitimate uses but this is not one if them

The game is incomplete. This is just a test and I
am a beginner to C#. Please deal with me fairly.

It's a 4x5 grid map, the player spawns right in the middle, an item spawns randomly everytime the code runs.

The movement keys wait for user input (WASD), then it adds and subtracts player coordinates and refreshes the grid to see that the player has moved.

The player poses as the digits 0-5 which represents both the player and his health. I'm planning on to create an enemy or a hurt zone to test it out.


The problem is, the grid stays invisible after user input.

>goto in any high level language
Shiggy

>Please deal with me fairly.
This is fucking Jow Forums. You didnt even read the FAQ. Why should we bother with this shit?

You're lucky we're even replying.

>"you literally have no reason to"
>proceeds to give at least one (1) valid reason

I was expecting guidance, dickheads. Be a decent
human being and help me out.

>I was expecting..

We were expecting YOU to read the FAQ as a completely brand new user. You can barely fucking reply.

Be a decent human bean and read it you tard.

Alright, now I think you’re trolling

The only thing you should expect is to be cursed at or ignored. Do ask yourself why people should help you at all though with this attitude "help me dickhead"

Perhaps change WASD to lowercase characters

just plugin the pocculant refurberations

don't listen to this guy, change to arrows keys. That should solve the problem :^)

>Do ask yourself why people should help you at all though with this attitude "help me dickhead"
---------------------------------------------------------------------
my attitude?
look what this guy said first...
---------------------------------------------------------------------
>Kill yourself

user I suggest you learn about while loops.
You seem to understand for loops just fine, so I don't see any reason why you wouldn't pick them up quite quickly

ive been here years da fucks a faq

Attached: 9k=.jpg (205x246, 6K)

Okay I will deal with you fairly. Please continue learning C# and learn to use code tags before you come back. People are being mean to you because you are using the language in a procedural way and will not work as your game grows. It shows that you are asking for help before taking the effort to learn the language. This would be acceptable if you were programming in 6502 assembly or BASIC, but not C#.

Once you have a better grasp on C#, rewrite all of your code. You have not written very much.

dont you mean E?

it's you.

Did this work, user? I’m having the same problem

why don't you just use functions?
What's the point of using an Object Oriented language when you are gonna code like you are in assembly?

You're telling me, that you (not OP), are having exactly the same problem as OP, with his specific problem.

Show us your code using code tags O- I mean not-OP.

You wouldn't have these problems if you just used functions.

I have switched "for" to "while". It does not work
as I expected. For some reason, the grid won't
show up anymore.

> Please continue learning C# and learn to use code tags before you come back
I've just finished learning Arrays and this grid
scroller idea came to me. I did what I could with
what I've learned so far. If you know C# so
much, why can't you just help me out instead
of being so prideful of your intellect that even
I can't talk to you cause I'm not on your level?
Bitch.

>If you know C# so
much, why can't you just help me out instead
of being so prideful of your intellect that even
I can't talk to you cause I'm not on your level?
Because you refuse to read the FAQ and use Jow Forums etiquette. Stop wasting our time, delete the thread and post it again using code tags.

>Perhaps change WASD to lowercase characters
I thought switching to lower case characters
would've fixed it too. I did, and it resulted the same
thing.

>What's the point of using an Object Oriented language
Actually whatsapp exactly ist Thema pointiert compared total Script language like js

Fuck off OP.

>Perhaps change WASD to lowercase characters
It worked! I changed ReadKey(); to ReadLine(); and
changed to lowercase characters!

thank you for this wasted trips you fucking german autocorrect.

So again:
>What's the point of using an Object Oriented language
Actually what exactly is the point compared to script language like js, python or normal stuff like c?

>Bitch.
take a bath OP, you stinky

using System;

namespace mainProject
{
class mainClass
{
public static void Main(string[] args)
{
Random numGen = new Random();
int rand1 = numGen.Next(1, 5);
int rand2 = numGen.Next(1, 5);
int plyPOSX = 2;
int plyPOSY = 2;
string movement;
int item = 8;
int playerHealth = 5;
int width = 5;
int height = 5;
int[,] grid = new int[width,height];

frame:

grid[rand1,rand2] = item;
grid[plyPOSX,plyPOSY] = playerHealth;

for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
Console.Write(grid[x,y] + " ");
}
Console.WriteLine();
}

move:
Console.WriteLine("Use WASD to walk.");
movement = Convert.ToString(Console.ReadLine());

if (movement == "w")
{
plyPOSY = plyPOSY - 1;
goto frame;
}
else if (movement == "s")
{
plyPOSY = plyPOSY + 1;
goto frame;
}
else if (movement == "a")
{
plyPOSX = plyPOSX - 1;
goto frame;
}
else if (movement == "d")
{
plyPOSX = plyPOSX + 1;
goto frame;
}
else
{
goto move;
}
}
}
}


Here you go, fags.

>Here you go, fags.
>can´t read the faq
>tries to be superior
Fuck off and learn how to use functions.

Post it on stack overflow if you don't know why you should be using functions as opposed to GOTO statements.

They'll school you.

>This car is incomplete
>Holds up rock

I'll give you a honest tip.
Read about classes and methods. You shouldn't have any function longer than 5-7 lines. Main function should probably have up to 2 lines. A class shouldn't do more than one thing. Rewrite it into proper program, and you will probably be able to easily debug it yourself. This, and any other future problems. If you don't know where to start, read "Clean Code" by Robert Martin.
I'm not even doing this to spite you. You'll thank me later if you actually do this.

What do you mean it doesn't loop?
it doesn't start or something?
or just iterates once?

>Wants to learn C#
>Insists on using gotos
>Insists on using gotos to make a game
This is a recipe for disaster, friend.

and , and everyone else telling you to use functions are giving you good advice. It will make things way easier for you going forward.

>I've just finished learning Arrays
Learn more of the language, and more about programming for that matter, before attempting to make a game. Games are the shittiest, least fun things to make and it's apparent that you're a newbie programmer. Use Stack overflow, or codecademy, or wherever the hell you prefer to learn things online. It'll save you a lot of trouble later on.

>You shouldn't have any function longer than 5-7 lines
t. Pajeet whos never worked on anything but helloworld programs.

Do NOT listen to this guy, except for:
>Read about classes and functins

> You shouldn't have any function longer than 5-7 lines
wut

Nope, just you OP, you're fucking retarded.

Attached: 03.jpg (500x465, 30K)

In all honesty the program should run but OP is useless and doesn't even give the output, he just wants us to figure out everything.

It's so funny when nublets get butthurt when no one will just fix their horrendous code.

Protip: your approach is so out of line with how anyone would solve your problem that spoonfeeding you is the worst possible thing any of us could do

how about reading you code one step at a time regardless of what you "expect" to happen.
also not you personal tech support or smthng idk just read the sticky

So... Is this your fist day here or what?

unironically, this

robmiles.com/c-yellow-book/
Read this. I'm not going to get my hopes up seeing as you didn't read the FAQ though.