Skip to content

Instantly share code, notes, and snippets.

View Ex094's full-sized avatar

Muhammad Aslam Ex094

View GitHub Profile
@Ex094
Ex094 / psr.py
Created November 20, 2013 15:57
A Simple Paper, Scissor, Rock game in Python, Might be buggy
import random
from random import choice
user_score = 0
pc_score = 0
usr_choice = ['paper', 'scissor', 'rock']
user_name = input('Please enter your good name: ')
@Ex094
Ex094 / morseclass.py
Created November 20, 2013 15:55
A Small Python Class I made for encoding and decoding Morse code Thanks to Arkphaze for code improvements
class ex094morse:
morse_alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
morse_encode = ['.-', '-...', '-.-.', '-.', '.', '..-.', '--.', '....', '..', '.---', '-.-', '.-..', '--', '-.', '---', '.--.', '--.-', '.-.','...' ,'-' ,'..-' ,'...-' ,'.--' ,'-..-' ,'-.--' ,'--..' ,'-----' ,'.----','..---','...--','....-','.....','-....','--...','---..','----.']
def encode(self, text):
store = ''
@Ex094
Ex094 / ranpass.cs
Created November 20, 2013 15:51
A small C# Snippet to generate random password of a given length
//Coded By Ex094
Random rnd = new Random(); //To Generate Random Numbers for string Index
string password = ""; //Variable to store the final Password
string passlist = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,./'[]~!@#$%^&*()_+=-|}{:?><";
Console.WriteLine ("Enter Password Length:");
string usrleng = Console.ReadLine(); //Get length from user in the form of string
@Ex094
Ex094 / bubblesort.py
Created November 20, 2013 15:48
My Python Implementation of BubbleSort
def bubblesort(items):
length = len(items) - 1 #Length of the list to be sorted
swapped = False #Swapping set to False as Default
while swapped != True:
for i in range(0, length):
@Ex094
Ex094 / mergesort.cpp
Last active December 28, 2015 21:19
My Merge Sort Implementation in C++
#include "stdafx.h"
#include "iostream"
#include "vector"
std::vector<int> merge_list(std::vector<int> left, std::vector<int> right) {
//This vector holds all the items in sorted form at the end
std::vector<int>result;
//These variables will be used to iterate through the items