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 List<string> Tokenize(string expression) | |
{ | |
//essentiall replaces double quotes with " and apostrophys with "'" | |
//I prefer dealing with searching for " then " as they tend to be a pain in the regex | |
var tempExpression = System.Security.SecurityElement.Escape(expression); | |
string doubleQuote = """; | |
//looks for an optional not and whitespace then an expression starting with a quote | |
//and ending with a quote" our representation of a string | |
//followed by whitespace and an optional logical operation that identifies the |
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 Main() | |
{ | |
//The user input expression | |
var expression = "\"java\" and \"SQL\" and \"C#\" or \"VB.NET\""; | |
//The collection of tokens that we will use to evaluate the logic in the expression | |
var tokens = Tokenize(expression); | |
//tokens.Dump(); | |
//Our evaluated representation of the tokens; We can use this to |
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 Main() | |
{ | |
//The user input expression | |
var expression = "\"java\" and \"SQL\" and \"C#\" or \"VB.NET\""; | |
//The collection of tokens that we will use to evaluate the logic in the expression | |
var tokens = Tokenize(expression); | |
//tokens.Dump(); | |
//Our evaluated representation of the tokens; We can use this to |
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
var hasLowercase = function (val) { | |
var patt = new RegExp(/([a-z]+)/g);//checks for 1 or more a-z characters. | |
return patt.test(val); | |
}; | |
var hasUppercase = function (val) { | |
var patt = new RegExp(/([A-Z]+)/g);//checks for 1 or more A-Z characters. | |
return patt.test(val); | |
}; |
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
/// <summary> | |
/// Restores the player to the starting point to try the level again. | |
/// </summary> | |
public void StartNewLife() | |
{ | |
//First try at default start position | |
Player.Position= start; | |
//get the distance from the player the enemies need to be | |
var playerRange = Enumerable.Range((int)Player.Position.X - 3, (int)Player.Position.X + 3); |
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
var Musician = { | |
FirstName:"Prince", | |
MiddleName:"Rogers", | |
LastName:"Nelson", | |
StageName:"Prince" | |
} |
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
var Musician = { | |
FirstName:"Prince", | |
MiddleName:"Rogers", | |
LastName:"Nelson", | |
StageName:"Prince" | |
} | |
Musician.StageName ="The Artist Formerly know as "+Musician.StageName; | |
Musician.StageName ="Jamie Starr"; | |
Musician.StageName ="Christopher"; | |
Musician.StageName ="Alexander Nevermind"; |
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
#include "PhysicsEdgeActor.h" | |
PhysicsEdgeActor::PhysicsEdgeActor(void) | |
{ | |
this->_shapeType = SHAPETYPE_EDGE; | |
this->_edge = b2EdgeShape(); | |
PhysicsActor::SetShapeType(SHAPETYPE_EDGE); | |
} |
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
#include "StdAfx.h" | |
#include "RubeLoader.h" | |
#include "rubestuff/b2dJsonImage_OpenGL.h" | |
using namespace std; | |
//--Comparer | |
bool compareImagesByRenderOrder_ascending(const b2dJsonImage_OpenGL* a, const b2dJsonImage_OpenGL* b) | |
{ | |
return a->renderOrder < b->renderOrder; |