Skip to content

Instantly share code, notes, and snippets.

View abdualblooshi's full-sized avatar
🎯

Abdulrahman Alblooshi abdualblooshi

🎯
View GitHub Profile
@abdualblooshi
abdualblooshi / warmup.ipynb
Created October 8, 2025 05:57
warmup.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abdualblooshi
abdualblooshi / image_processing_lab.ipynb
Created October 1, 2025 06:00
image_processing_lab.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import java.util.Arrays;
public class App {
public static void main(String[] args) throws Exception {
// calculating how many times a number is repeated in an array
int[] arr = new int[50];
for (int i = 0; i < arr.length; i++) {
arr[i] = (int) (Math.random() * 10) + 1;
@abdualblooshi
abdualblooshi / fraction.py
Last active March 27, 2022 14:27
Calculating rational fractions using python and displaying them as fractions instead of decimals
from collections import Counter
class Fraction(object):
"""
A number represented as a fraction
"""
def __init__(self, num, denom):
assert type(num) == int and type(denom) == int, "ints not used"
self.num = num
self.denom = denom
def __str__(self):
@abdualblooshi
abdualblooshi / towers_of_hanoi.py
Created March 9, 2022 13:13
Towers of Hanoi Recursion
def Towers(n, fr, to, spare):
if n > 0:
Towers(n-1, fr, spare, to)
# When you add an f you can print variables using
# {} instead of using the print function directly
# without the need of concatenation.
print(f'move disk from {fr} to {to}')
Towers(n-1, spare, to, fr)
Towers(31, "A", "C", "B") # A, B, C are the towers