Skip to content

Instantly share code, notes, and snippets.

View Shiro-Raven's full-sized avatar
🪔
Contemplating the stars

Ahmed Darwish Shiro-Raven

🪔
Contemplating the stars
View GitHub Profile
@Shiro-Raven
Shiro-Raven / kNN.hs
Created March 13, 2020 13:18
k-nearest neighbors using Haskell for classifying passing students
import Data.List
data Ex = Ex Float Float String String deriving Show
data NewSt = NewSt Float Float String deriving Show
data Dist = Dist Float NewSt Ex deriving Show
euclidean :: NewSt -> Ex -> Dist
euclidean (NewSt midterm1 quiz1 name1) (Ex midterm2 quiz2 name2 label2) = (Dist (sqrt( (midterm1-midterm2)*(midterm1-midterm2) + (quiz1-quiz2)*(quiz1-quiz2))) (NewSt midterm1 quiz1 name1) (Ex midterm2 quiz2 name2 label2))
@Shiro-Raven
Shiro-Raven / battleship.pl
Last active March 13, 2020 13:12
battleship Prolog solver
:- use_module(library(clpfd)).
%10*10 test
at(3, 5, c).
at(5, 0, w).
at(9, 6, c).
%4*4 test
%at(2,0,c).
%at(2,1,r).
@Shiro-Raven
Shiro-Raven / ..Image Filters Assignment
Last active December 28, 2019 20:21
Code for the second assignment of the Computer Vision course
We couldn’t find that file to show.