This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
namespace XScript.Helpers | |
{ | |
public sealed class EvalHelper | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Matrix Invert(Matrix matrix) | |
{ | |
Matrix matrix2; | |
float num5 = matrix.M11; | |
float num4 = matrix.M12; | |
float num3 = matrix.M13; | |
float num2 = matrix.M14; | |
float num9 = matrix.M21; | |
float num8 = matrix.M22; | |
float num7 = matrix.M23; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Also note, this is pseudo-code, when passing the index to a function, you want to pass it as a reference so that you can modify the index. | |
void Tokenize(string src) | |
{ | |
int ind = 0; | |
string configName = empty; | |
while(ind < src.Length) | |
{ | |
char c = src[ind]; | |
if(c == '#') | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef unsigned char byte; | |
struct OpCode | |
{ | |
byte Prefix : 4; | |
byte Code : 4; | |
}; | |
struct TypeCodes | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Queue<Point> _floodQueue = new Queue<Point>(); | |
public static void FloodFill(Point start, Tile tile, MapRenderer map, DrawLayer layer) | |
{ | |
if (map.ContainsTilePoint(start.X, start.Y)) | |
{ | |
Tile startTile = map.GetTile(start.X, start.Y, layer); | |
if (startTile != tile) | |
{ | |
_floodQueue.Clear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
template<class T> | |
class List | |
{ | |
private: | |
int bufferSize,top,sizeCap; | |
public: | |
T* buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define FASTDRAW | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
//using System.Drawing; | |
using System.IO; | |
using System.Windows.Forms; | |
using Microsoft.Xna.Framework; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int generateKey(char* dest,char* format,unsigned int seed) | |
{ | |
if(dest && format) | |
{ | |
srand(seed); | |
int len = strlen(format); | |
for(int i = 0; i < len; i++) | |
{ | |
switch(format[i]) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void getMin(double* values,int c, double & result) | |
{ | |
//If count is greater than 0, find the min. | |
if(c > 0) | |
{ | |
//Set result to the first value. | |
result = values[0]; | |
//Begin looping through each value | |
for(int i = 1; i < c; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int arr[5]; | |
int input = 0; | |
arr[0] = INT_MAX; | |
arr[1] = INT_MAX; | |
arr[2] = INT_MAX; | |
arr[3] = INT_MAX; | |
arr[4] = INT_MAX; | |
for(int i = 0; i < 5; i++) | |
{ | |
cin >> input; |
OlderNewer