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
function clone(object) | |
local lookup_table = {} | |
local function _copy(object) | |
if type(object) ~= "table" then | |
return object | |
elseif lookup_table[object] then | |
return lookup_table[object] | |
end | |
local new_table = {} | |
lookup_table[object] = new_table |
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 "PanZoomLayer.h" | |
PanZoomLayer::PanZoomLayer() | |
{ | |
} | |
PanZoomLayer::~PanZoomLayer() |
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
// Create animatino class and run it | |
CCNode *anim = MyAnimation::create( "gamescene/star_sprite_animation.json" ); | |
anim->PlayWithSequence( "eaten" ); |
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
/** | |
* Delegate method called before the text has been changed. | |
* @param textField The text field containing the text. | |
* @param range The range of characters to be replaced. | |
* @param string The replacement string. | |
* @return YES if the specified text range should be replaced; otherwise, NO to keep the old text. | |
*/ | |
- (BOOL)textField:(UITextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | |
{ | |
NSUInteger oldLength = [textField.text lengthOfBytesUsingEncoding:(0x80000000 + kCFStringEncodingDOSKorean)]; |
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 init( int arr[], int size, int value ) | |
{ | |
int i; | |
for( i=0; i<size; i++ ) | |
arr[i] = value; | |
} | |
void merge( int arr[], int leftstart, int leftend, int rightstart, int rightend ) | |
{ | |
int* tmp = new int[ rightend - leftstart + 1]; |
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 <stdio.h> | |
int main() | |
{ | |
int sum = 0; | |
int i; | |
for( i=0; i<5; i++ ) | |
{ | |
sum = sum + i; |
NewerOlder