Skip to content

Instantly share code, notes, and snippets.

View razimantv's full-sized avatar

Raziman T V razimantv

  • Imperial College London
  • London, United Kingdom
  • 04:18 (UTC +01:00)
  • X @razimantv
View GitHub Profile
@razimantv
razimantv / covfefe.ipynb
Created January 5, 2018 10:51
Solving the covfefe problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / battleship.cpp
Created February 25, 2018 23:19
Given the shape of a ship and the location of one cell, bomb the remaining cells in minimum attempts
#include <iostream>
#include <map>
#include <random>
#include <tuple>
#include <vector>
std::random_device rd;
std::mt19937 gen(rd());
typedef std::vector<std::string> pattern;
@razimantv
razimantv / ImpossiblePuzzle.ipynb
Last active October 4, 2018 00:50
Programmatic solution to the "Impossible puzzle"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / Pi_MC.ipynb
Created October 4, 2018 12:37
Monte Carlo estimation of Pi
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / population_evolution.cpp
Last active November 20, 2018 21:50
Dependence of population evolution on age of giving birth
#include <fstream>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <tuple>
// Birth/death events
// If birth: time, +1, 0
// If death: time, -1, birthday
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / Randomstrip.ipynb
Created February 18, 2019 19:05
Generate random points in an angle range around a given latitude and longitude
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / towers.cpp
Created April 9, 2020 20:04
Solution to the towers puzzle
/******************************************************************************
* File: towers.cpp
*
* Author: Raziman T V
* Created: 04/09/20
* Description: Solving the Towers puzzle
*****************************************************************************/
#include <algorithm>
#include <cassert>
@razimantv
razimantv / primes.cpp
Last active October 12, 2020 02:50
Comparing prime generation the old way and the C++20 way
#include <chrono>
#include <iostream>
#include <numeric>
#include <ranges>
#include <vector>
const int N = 10000000;
int main() {
auto t1 = std::chrono::steady_clock::now();