Skip to content

Instantly share code, notes, and snippets.

View devpruthvi's full-sized avatar
🎯
Focusing

Pruthvi Raj devpruthvi

🎯
Focusing
View GitHub Profile
firstclass = [0,0,0,0,0,0,0,0] #list that stores first class data
economyclass = [0,0,0,0,0,0,0,0] #list that stores economy class data
booked = {} #Stores names and seat numbers of booked people
def displayseats(): #This will display seats in a formatted way
print("First Class Economy Class")
for each in range(0,4):
if firstclass[each] == 0:
print("(" +str(each+1) + ")", end='')
@devpruthvi
devpruthvi / Airline Project Part 1
Created October 2, 2014 18:54
Airline Project Part 1 solution
firstclass = [0,0,0,0,0,0,0,0] #list that stores first class data
economyclass = [0,0,0,0,0,0,0,0] #list that stores economy class data
booked = {} #Stores names and seat numbers of booked people
def displayseats(): #This will display seats in a formatted way
print("First Class Economy Class")
for each in range(0,4):
if firstclass[each] == 0:
print("(" +str(each+1) + ")", end='')
@devpruthvi
devpruthvi / Airline-Corrected.py
Last active August 29, 2015 14:07
Airline after some corrections
firstclass = [0]*8 #list that stores first class data
economyclass = [0]*8 #list that stores economy class data
booked = {} #Stores names and seat numbers of booked people
def displayseats(): #This will display seats in a formatted way
print("First Class Economy Class")
for each in range(0,4):
if firstclass[each] == 0:
print("(" +str(each+1) + ")", end='')
<pre class="brush: jscript; title: ; notranslate" title="">
var generate = function (len, chars) {
var ret = '',
charsLen = chars.length;
while (len--) {
ret += chars[Math.floor(Math.random() * charsLen)];
}
return ret;
};
import random
import string
availablewords = ['anaconda','all of me','rude','chandelier','guts over fear','maps']
punc = set(string.punctuation)
hangman = "HANGMAN"
tried = set()
def hangmangame():
again = True
while again:
alreadySaid = set(['a','e','i','o','u','A','E','I','O','U'])
@devpruthvi
devpruthvi / Conway's game of life
Last active August 29, 2015 14:07
Conway's Game of Life
import pygame, sys
from pygame.locals import *
FPS = 4
csize = 10
wwidth = int(input("Enter width of the table: "))*csize
wheight = int(input("Enter size of the table: "))*csize
cwidth = wwidth / csize
@devpruthvi
devpruthvi / CQLL
Last active April 29, 2021 19:00
Circular Queue using Linked List C++
#include<iostream>
#define SIZE 100
using namespace std;
class node
{
public:
node()
### A program to download wallpapers from alphacoders.com
###Author: N.V.Pruthvi Raj, Anantapur, India.
###Date: 23/12/2014
import requests
import shutil
import re
import os
from bs4 import BeautifulSoup
url = 'http://wall.alphacoders.com/by_sub_category.php?id=173173&name=Naruto&page=1'
baseurl = url[0:url.find('page=')+5]
@devpruthvi
devpruthvi / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@devpruthvi
devpruthvi / 11(a).java
Created January 26, 2015 11:36
Calculator program
package apples;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.script.ScriptEngineManager;
import javax.script.ScriptEngine;
import javax.script.ScriptException;