Skip to content

Instantly share code, notes, and snippets.

Avatar
📚
Focusing on studies

Muhammad Muzzammil muhammadmuzzammil1998

📚
Focusing on studies
View GitHub Profile
@muhammadmuzzammil1998
muhammadmuzzammil1998 / groups.js
Last active Jan 7, 2021
A simple script used to allocate students to random groups without biasness or discrimination.
View groups.js
const fs = require("fs"),
names = fs.readFileSync("./names.txt").toString().split("\r\n"),
noOfGroups = 10,
noOfStudents = Math.ceil(names.length / noOfGroups)
let groups = []
for (i = 0; i < noOfGroups; i++) {
groups.push([])
}
@muhammadmuzzammil1998
muhammadmuzzammil1998 / CarlFriedrichGauss.c
Created Sep 15, 2017
Carl Friedrich Gauss's anecdote of how he summed up 1 to 100 in an interesting manner using a for loop.
View CarlFriedrichGauss.c
/*
* I was reading about Carl Friedrich Gauss's anecdote of how he summed up 1 to 100
* in an interesting manner. So, I wanted to make it with a loop (I know, I am a
* lazy guy) and came up with this pretty quickly... so quickly that I thought I did
* it wrong but the output was same as the great mathematician. But I think that
* there is some another and easy way to do this, right?
*/
#include <stdio.h>