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 <iostream.h> | |
#define N_MAX 2048 | |
typedef struct{ | |
int num; | |
int easyDone; | |
int easyStar; | |
int hardDone; | |
int hardStar; |
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
/* | |
Input: | |
- (void)viewWillDisappear:(BOOL)animated; | |
Output: | |
- (void)viewWillDisappear:(BOOL)animated{ | |
[handler_ viewWillDisappear:animated]; | |
} | |
*/ |
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 POP_ALERT(title, msg) [[[[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]autorelease] show] | |
/* | |
Usage: | |
POP_ALERT(@"Title Here", @"Message Here"); | |
*/ |
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
/** Logic 1 */ | |
-(BOOL)funcOfBase:(int)b multiple:(int)n{ | |
return ((_slots[b]==_aType) && (_slots[b+n*1]==_aType) && (_slots[b+n*2])==_aType); | |
} | |
-(BOOL)checkWin{ | |
int bases[5] = {0, 1, 2, 3, 6}; | |
int multiples[5][4] = { | |
{1, 3, 4, 0}, | |
{3, 0, 0, 0}, |
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
if(troop_position == 4){ | |
for(int possible_position = 0; possible_position < 9; possible_position++){ | |
if(_slots[possible_position] == -1){ | |
availPos[troop_number][available_position[troop_number]++] = possible_position; | |
} | |
} | |
}else{ | |
for(int possible_position = 0; possible_position < 3; possible_position++){ | |
if(_slots[_nextPossiblePositions[troop_position][possible_position]] == -1){ | |
availPos[troop_number][available_position[troop_number]++] = _nextPossiblePositions[troop_position][possible_position]; |
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
/* | |
At create setup stage | |
*/ | |
glEnableVertexAttribArray(GLKVertexAttribPosition); | |
glVertexAttribPointer(GLKVertexAttribPosition, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(0)); | |
glEnableVertexAttribArray(GLKVertexAttribNormal); | |
glVertexAttribPointer(GLKVertexAttribNormal, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12)); | |
/* | |
At binding stage |
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 main (int argc, const char * argv[]){ | |
// Create the main window | |
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); | |
// Load a sprite to display | |
sf::Texture texture; | |
if (!texture.loadFromFile(resourcePath() + "cute_image.jpg")) | |
return EXIT_FAILURE; | |
sf::Sprite sprite(texture); |
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
/* | |
Electricity: | |
resolution_ = 0; means straight line | |
pointA_, pointB_; are vec4s | |
*/ | |
void ElectricCurrent::createVertexData(){ | |
int tfloats = (2+resolution_) * 4; //num_points * num_floats_per_point | |
GLfloat data[tfloats]; | |
int atIndx = 0; |
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
/* | |
This piece of shit that I wrote does one simple task: linearly interpolate between 0.0 and 1.0 for the value 'res'. | |
This is a sample run: | |
$ ./mix 1 | |
0: 0.500000 | |
$ ./mix 2 | |
0: 0.333333 | |
1: 0.666667 | |
$ ./mix 3 | |
0: 0.250000 |
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
// | |
// SJViewController.m | |
// TestSkybox | |
// | |
// Created by Sidharth Juyal on 22/06/12. | |
// Copyright (c) 2012 whackylabs. All rights reserved. | |
// | |
#import "SJViewController.h" |
OlderNewer