Original Post
Testing..
Testing..
[source lang="cpp"]
[/source]
for (int i = 0; i < 30; i++)
{
// Do something
}
for (int i = 0; i < 30; i++)
{
}
[source]
for (int i = 0; i < 30; i++)
{
// Do something
}
[/source]
// Some source code
class Foo
{
public int Bar { get; set; }
}
// Some source code
class Foo
{
public int Bar { get; set; }
}
// testing
[source lang="cpp"]
// Some source code
class Foo
{
public int Bar { get; set; }
}
[/source]
// Some source code
class Foo
{
public int Bar { get; set; }
}
// Some source code
class Foo
{
public int Bar { get; set; }
}
Testing
// testing
testing
source
public class MyVector
{
public int X { get; set; }
public int Y { get; set; }
}
class Program
{
public static T AddVector<T>(T a, T b)
where T : MyVector, new()
{
T newVector = new T();
newVector.X = a.X + b.X;
newVector.Y = a.Y + b.Y;
return newVector;
}
static void Main(string[] args)
{
MyVector a = new MyVector();
a.X = 1;
a.Y = 2;
MyVector b = new MyVector();
b.X = 10;
b.Y = 11;
MyVector c = AddVector(a, b);
Console.WriteLine(c.X + ", " + c.Y);
}
}
Code here..
const int map_width = 20, map_height = 20;
int[,] map = new int[map_width, map_height];
// open a StreamReader to read the index
string path = Path.Combine(StorageContainer.TitleLocation, "Content\\map.txt");
using (StreamReader reader = new StreamReader(path))
{
int y = 0;
while (!reader.EndOfStream)
{
// get a line
string line = reader.ReadLine();
// split at the equals sign
string[] parts = line.Split(',');
for (int x = 0; x < parts.length; x++)
{
map[x,y] = Convert.ToInt32(parts[x]);
}
y++;
}
}
test
test
[source]
test
[/source]
[source lang="auto"]
[eqn]a^2+b^2=c^3[/eqn]
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more