Skip to content

Instantly share code, notes, and snippets.

View defrindr's full-sized avatar
👋
Hi there

Defri Indra Mahardika defrindr

👋
Hi there
View GitHub Profile
int b1,b2,b3,b4,b5,positif,negatif,gajil,genap;
if b1 % 2 == 0 : genap++;
else : ganjil++;
if b2 % 2 == 0 : genap++;
else : ganjil++;
if b3 % 2 == 0 : genap++;
else : ganjil++;
if b4 % 2 == 0 : genap++;
else : ganjil++;
@defrindr
defrindr / prime.c
Last active November 15, 2021 06:43
#include <stdio.h>
int main()
{
int bilangan,dibagi_sebanyak;
printf("Masukan bilangan : ");
scanf("%d", &bilangan);
@defrindr
defrindr / sudokusolver.py
Created September 30, 2020 03:24
sudoku solver with backtracking algorithm
# Langkah Langkah :
# 1. Cari cell yang bernilai 0
# 2. brute cell dengan angka 1-9
# 3. check apakah terjadi duplikasi pada row
# 4. check apakah terjadi duplikasi pada col
# 4. check apakah terjadi duplikasi pada box
# 5. ubah nilai dari cell dengan angka hasil brute force
# 6. kembali kelangkah 1
# 7 jika langkah 6 menghasilkan True maka ubah kembali nilai dari step 5 ke 0
@defrindr
defrindr / type1.c
Last active September 23, 2020 13:02
#include <stdio.h>
int main() {
int x, y;
printf("Masukkan x y : ") ;
scanf("%d %d", &x, &y) ;
if(x>0&&y>0) { printf(" Kuadran 1");}
else if(x<0&&y>0) { printf(" Kuadran 2");}
else if(x<0&&y<0) { printf(" Kuadran 3");}

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

@defrindr
defrindr / _mapel.md
Last active September 19, 2020 10:03

Matematika 1

@defrindr
defrindr / _mapel.md
Last active September 21, 2020 10:38

MATEMATIKA DISKRIT

@defrindr
defrindr / _mapel.md
Last active September 16, 2020 11:42

Konsep Pemrograman

@defrindr
defrindr / _Project Euler Solution.md
Last active September 1, 2020 09:02
ProjectEuler.net Solution In Javascript

ProjectEuler.net Solution In Javascript

@defrindr
defrindr / egcd.js
Last active August 30, 2020 06:08
Extended Euclidean
const egcd = (a, b) => {
[x, y, _x, _y] = [0, 1, 1, 0];
while (a !== 0) {
div = parseInt(b / a),
mod = b % a;
nx = x - _x * div,
ny = y - _y * div;