Skip to content

Instantly share code, notes, and snippets.

View MustafaAnasKH99's full-sized avatar
👽
:=]

Mustafa Anas MustafaAnasKH99

👽
:=]
View GitHub Profile
@MustafaAnasKH99
MustafaAnasKH99 / Toggler.js
Created September 30, 2019 11:37
A react component that randomly choose a word and displays it in a sentence from a provided array of strings.
import React, { Component } from 'react';
class Toggler extends Component {
constructor(props) {
super(props);
this.state = {
do: 'Change default value'
};
}
@MustafaAnasKH99
MustafaAnasKH99 / python_snake.py
Created April 7, 2019 17:27
Pure Python Snake Game
# INSTRUCTIONS: - UP, RIGHT, DOWN, LEFT, ARROWS TO PLAY
# - 'SPACEBAR' TO PAUSE / RESUME
# - PRESS 'ESC' BUTTON WHILE THE IS CURSER MOVING TO QUIT. WILL NOT ESCAPE IF PAUSED.
# - HAVE FUN!! It's even more breaking down the code and understanding it all! :)
#
# UPDATE: Corrected my comments to reflect python syntax. No more "array".
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN, A_BOLD, A_UNDERLINE
@MustafaAnasKH99
MustafaAnasKH99 / unite_unique.py
Created April 4, 2019 22:21
Unite Unique numbers in array - Mustafa Anas
# Challenge Solved in Python - Mustafa Anas
def unite_unique(*args):
united_lists = []
unique_list = []
for i in args:
united_lists += i
for i in united_lists:
@MustafaAnasKH99
MustafaAnasKH99 / sumAll.py
Created April 4, 2019 22:02
Sum all numbers in a range - Mustafa Anas
# Challenge Solved in Python - Mustafa Anas
def sumAll(lst):
item1 = lst[0]
item2 = lst[-1]
summed = 0
if item2 > item1:
final_list = list(range(item1, item2+1))
for i in final_list: