This file contains hidden or 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
- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
//Enable test mode to view your events in the Validator. Remove this line of code before releasing your game to the app store. | |
[Playnomics setTestMode: YES]; | |
const unsigned long long applicationId = <APPID>; | |
[Playnomics startWithApplicationId:applicationId]; | |
//preloads the frames at game start | |
[Playnomics preloadFramesWithIds:@"frame-ID-1", @"frame-ID-2", @"frame-ID-2", @"frame-ID-3", nil]; | |
//other code to initialize your iOS application below this |
This file contains hidden or 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
id<PlaynomicsFrameDelegate> frameDelegate; | |
/* | |
frameDelegate is delegate which observes state changes in the frame: | |
@protocol PlaynomicsFrameDelegate <NSObject> | |
@optional | |
-(void) onShow: (NSDictionary *) jsonData; | |
-(void) onTouch: (NSDictionary *) jsonData; |
This file contains hidden or 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
//copy this into an activity | |
public boolean isGooglePlaySdkAvailable(){ | |
try{ | |
Class.forName("com.google.android.gms.common.GooglePlayServicesUtil"); | |
return true; | |
} catch(ClassNotFoundException exception){ | |
logger.log(LogLevel.WARNING, "Google Play Services are not available on this device."); | |
} | |
return false; | |
} |
This file contains hidden or 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
class Node | |
attr_accessor :data, :adjacents, :visited? | |
def initialize(data) | |
self.data = data | |
self.visited? = false | |
self.adjacents = [] | |
end | |
end | |
def dfs(node) |
This file contains hidden or 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
class Node | |
attr_accessor :data, :adjacents, :visited? | |
def initialize(data) | |
self.data = data | |
self.visited? = false | |
self.adjacents = [] | |
end | |
end | |
def bfs(node) |
This file contains hidden or 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
package main | |
//#cgo pkg-config: python2.7 | |
//#include <Python.h> | |
//static PyObject *runtime_log_fn; | |
// | |
//void runtime_log(char *msg) | |
//{ | |
// if (runtime_log_fn == NULL) { | |
// free(msg); |
OlderNewer