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
:small_blue_diamond: **Feature Title** | |
Feature Description, `code example`. | |
* Docs: [Web Name](https://example.com) | |
:arrow_forward: @Username | |
:clock1: 2nd July |
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
# Configuration file for libinput-gestures. | |
# | |
# The default configuration file exists at /etc/libinput-gestures.conf | |
# but a user can create a personal custom configuration file at | |
# ~/.config/libinput-gestures.conf. | |
# | |
# Lines starting with '#' and blank lines are ignored. Currently | |
# "gesture" and "device" configuration keywords are supported as | |
# described below. The keyword can optionally be appended with a ":" (to | |
# maintain compatibility with original format configuration files). |
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
N = 4 | |
chess_board = [[0 for i in range(N)] for j in range(N)] | |
print(chess_board) | |
queen_position = 1,2 | |
print("Horizontal") | |
queen_position_horizontal = 2,0 | |
for i in range(N): | |
print("2,",i) |
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
def solveMaze (Maze , position , N ,destination): | |
# returns a list of the paths taken | |
if position == destination: | |
return [ destination ] | |
x , y = position | |
if x + 1 < N and Maze[x+1][y] == 1: # Down | |
a = solveMaze( Maze , ( x + 1 , y ) , N , destination) | |
print("At",a) | |
if a != None: | |
return [ (x , y ) ] + a |
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
#! /usr/bin/python3 | |
def explore(i, j, grid_map_exp, grid_map): | |
if i <= 3 and j <= 3: | |
current = grid_map[i][j] | |
if current == 's' or current == '-': | |
explore(i, j+1, grid_map_exp, grid_map) | |
explore(i, j-1, grid_map_exp, grid_map) | |
explore(i+1, j, grid_map_exp, grid_map) |
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
""" | |
E --> nT | |
T --> *nT | @ | |
""" | |
def non_terminal_E(input_token, lookahead): | |
if input_token == "n": | |
lookahead = match(input_token,"n", lookahead) | |
non_terminal_T(input_token, lookahead) |
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
def partition(array, first, last): | |
pivot = array[last] | |
print "Pivot: ", pivot | |
index = first | |
for j in range(first,last): | |
print "Comparing ", array[j]," and ",pivot | |
if array[j] <= pivot: | |
print "Swapping ",array[j], " and ", array[index] |
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 sys | |
def search_func(initial, terminal, search_val, elements, position) : | |
# print (initial," to ",terminal) | |
difference = terminal - initial | |
#print "Diff :" , position + difference | |
elements = elements[initial:terminal] | |
length = len(elements) |
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
#! /usr/bin/python | |
import random | |
def sort_sublist (sort_list): #insertion sort | |
"Sorts the sub lists using insertion sort" | |
for j in range(1,len(sort_list)): | |
key = sort_list[j] #compare with next | |
i = j - 1 | |
while i >= 0 and sort_list[i] > key: #compare the key with the its left elements...if smaller swap |
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
#! /usr/bin/python | |
import random | |
list = list() | |
t = 0 | |
for i in xrange(10): | |
list.append(random.randrange(1,100,1)) #generate a list of ten random numbers between 1 and 100 | |
print "The unsorted list : ",list |
NewerOlder