Skip to content

Instantly share code, notes, and snippets.

View devpruthvi's full-sized avatar
🎯
Focusing

Pruthvi Raj devpruthvi

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python
#Author: Pruthvi Raj ( [email protected] )
#Date: 10-March-2016
import re, copy, random
class TicTacToe:
def __init__(self):
self.magic_square = [8, 1, 6, 3, 5, 7, 4, 9, 2]
#!/usr/bin/env python
#Author: Pruthvi Raj ( [email protected] )
#Date: 10-March-2016
import re, copy, random
class TicTacToe:
def __init__(self):
self.magic_square = [8, 1, 6, 3, 5, 7, 4, 9, 2]
import re,copy,random
class TicTacToe:
def __init__(self):
self.magic_square = [8,1,6,3,5,7,4,9,2]
self.player_marker = 'X'
self.computer_marker = 'O'
self.board = [' ']* 9
self.board_design = "| %s | | %s | | %s |\n| %s | | %s | | %s |\n| %s | | %s | | %s |"
self.player_playing = "n"
import numbers
def getNumber(s):
try:
return int(s)
except ValueError:
return float(s)
flag = True
while flag:
try:
score = raw_input('Enter score: ')
import numbers
def getNumber(s):
try:
return int(s)
except ValueError:
return float(s)
flag = True
nums = []
while flag:
try:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Sample Breakout Game</title>
<style type="text/css" media="screen">
*
{
padding: 0;
margin: 0;
/*
* Social Buttons for Bootstrap
*
* Copyright 2013-2015 Panayiotis Lipiridis
* Licensed under the MIT License
*
* https://github.com/lipis/bootstrap-social
*/
.btn-social{position:relative;padding-left:44px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.btn-social>:first-child{position:absolute;left:0;top:0;bottom:0;width:32px;line-height:34px;font-size:1.6em;text-align:center;border-right:1px solid rgba(0,0,0,0.2)}
from mutagen.mp3 import MP3
import subprocess,math
filepath = 'H:/Music/temp/'
filename = 'notafraid.mp3'
a = MP3(filepath + filename)
parts = int(math.ceil(a.info.length / 60))
for each in range(0,parts):
command = 'ffmpeg -ss {} -i {} -c copy -t {} {}{}'.format(each*60,filepath+filename,60,each,filename)
subprocess.call(command,shell=True)
@devpruthvi
devpruthvi / Bankers.c
Created November 19, 2015 02:22
Banker's Algorithm for deadlock avoidance in C
#include "stdafx.h"
#include<stdio.h>
#include<conio.h>
#define true 1
#define false 0
int available[10], allocation[10][10], max[10][10], need[10][10], work[10], finish[10], maxres[10], safe[10], req[10], m, n;
int find()
{
int i, j;
@devpruthvi
devpruthvi / MFT.c
Created November 18, 2015 18:30
MFT Operating Systems program in C
#include<stdio.h>
int mm, frs, p[15], fre1, fre2, fr, i = -1, fre;
int main()
{
char ch;
void insert();
void del();
void display();