Skip to content

Instantly share code, notes, and snippets.

@pncnmnp
pncnmnp / game_of_life.py
Last active February 28, 2019 13:19
conway's game of life ( simple implementation )
from termcolor import colored
import matplotlib.pyplot as plt
import matplotlib.animation as animation
class Conway:
def __init__(self):
self.N = 60
self.generations = 300
self.curr_board = [[0 for i in range(self.N)] for j in range(self.N)]
self.prev_board = [[0 for i in range(self.N)] for j in range(self.N)]
@pncnmnp
pncnmnp / 2d_tranformation.c
Last active April 21, 2019 21:44
"computer graphics" lab's code
#include<stdio.h>
#include<graphics.h>
#include<math.h>
// with math module don't forget to use '-lm'
// For a triangle
int trans_sx = 30;
int trans_sy = 30;
@pncnmnp
pncnmnp / output.gif
Last active May 31, 2019 10:03
Popup Encyclopedia : demos
output.gif
@pncnmnp
pncnmnp / bit_stuffing.c
Created November 6, 2019 01:25
Computer Network practical practise problems
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100
int main(void) {
char data[MAX], output_data[MAX+MAX];
printf("Enter the data: ");
scanf("%s", data);
.model small
.data
res1 db 10,13,"Enter the bcd value: $"
iresult db 10,13,"Hex value is: $"
result db 10,13,"Ascii value is: $"
.code
mov ax,@data
mov ds,ax
lea dx,res1
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
,text
0,"Alice’s Adventures in Wonderland
by Lewis Carroll
THE MILLENNIUM FULCRUM EDITION 3.0
Contents
CHAPTER I. Down the Rabbit-Hole
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
,text
0,"1595
THE TRAGEDY OF ROMEO AND JULIET
by William Shakespeare
Dramatis Personae
@pncnmnp
pncnmnp / genres.json
Created December 13, 2022 08:14
List of genres supported by Phoenix10.1 (https://github.com/pncnmnp/phoenix10.1)
This file has been truncated, but you can view the full file.
[
"rooms and buildings",
"Lautonom",
"m3nosu",
"okrutna realnost",
"painful",
"fahrradfahren bei nacht",
"music to fall asleep to",
"3 am",
"Same name not same song tag",
@pncnmnp
pncnmnp / words_of_life.py
Created December 16, 2022 04:22
Game of Life but with alphabets
# initialize the grid with random alphabets
import random
from itertools import permutations
from collections import Counter
import pickle
import enchant
# define the grid size
GRID_SIZE = 8
@pncnmnp
pncnmnp / fio.vim
Created April 1, 2023 11:19
Vim syntax file for Fio (Flexible I/O Tester)
" Vim syntax file for Fio (Flexible I/O Tester)
" Language: Fio
" Maintainer: Parth Parikh <parthparikh1999p@gmail.com>
" Last Change: 2023-04-01
" This code is licensed under Vim License:
" https://github.com/vim/vim/blob/master/LICENSE
" Fio files are a type of classic INI files
" This is a slight modification of: