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
Name: Rohit Jangid | |
Email id: rohit.nsit08@gmail.com | |
Google id: rohit.nsit08 | |
Other contact info: | |
Irc nick-name on #parrot channel: rohit_nsit08 | |
Project title: JavaScript on Parrot |
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
Name: Rohit Jangid | |
Email id: rohit.nsit08@gmail.com | |
Google id: rohit.nsit08 | |
Other contact info: | |
Irc nick-name on #parrot channel: rohit_nsit08 | |
Project title: JavaScript on Parrot |
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
NAME: Rohit Jangid | |
EMAIL ID: rohit.nsit08@gmail.com | |
GOOGLE ID: rohit.nsit08 | |
OTHER CONTACT INFO: | |
Irc nick-name on #parrot channel: rohit_nsit08 | |
PROJECT TITLE: JavaScript on Parrot |
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
NAME: Rohit Jangid | |
EMAIL ID: rohit.nsit08@gmail.com | |
GOOGLE ID: rohit.nsit08 | |
OTHER CONTACT INFO: | |
Irc nick-name on #parrot channel: rohit_nsit08 | |
skype id : rohit_nsit08 |
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
/*Problem description | |
Alice and Bob play the following game.They choose a number N to play with.The runs are as follows : | |
1.Bob plays first and the two players alternate. | |
2.In his/her turn ,a player can subtract from N any prime number(including 1) less than N.The number thus obtained is the new N. | |
3.The person who cannot make a move in his/her turn loses the game. | |
Assuming both play optimally,who wins the game ? | |
*/ | |
/*solution*/ | |
#include<stdio.h> |
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 protoParser = require("./js/parser").parser, | |
nodes = require("./js/nodes"), | |
codegen = require("./js/codegen"); | |
function Compiler () { | |
var constructors = {}, | |
prototypes = {}; | |
// Define AST nodes |
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 indentChar = ' '; //4 spaces | |
function idt (lvl) { | |
if (lvl < 0) lvl = 0; | |
return Array(lvl+1).join(indentChar); | |
} | |
var codegens = exports.nodes = { | |
'Empty': function Empty_codegen () { |
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
.namespace [] | |
.sub main | |
$P1 = subclass 'String', 'jsString' # subclass default string pmc into jsString type | |
addattribute $P1, 'primitive' | |
$P7 = box "ROHIT" | |
$P2 = new 'jsString' # instantiate the new string object | |
setattribute $P2, "primitive", $P7 |
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
// creates a binary search tree | |
#include<stdio.h> | |
#include<stdlib.h> | |
typedef struct node{ | |
struct node* left; | |
struct node* right; | |
int value; | |
}treenode; |
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
test gist application |
OlderNewer