Skip to content

Instantly share code, notes, and snippets.

@Codeplaza
Codeplaza / gist:7486449
Created November 15, 2013 15:46
Color Diamond
//A pattern by MADAN LAL The FASTian
#include<stdio.h>
#include<conio.h>
#include<windows.h>
void gotoxy(int,int);
int main()
{
int i,j,k;
@Codeplaza
Codeplaza / gist:7486381
Created November 15, 2013 15:43
Spiral
//This is program for spiral matrix. Spiral Matrix is a matrix with
//the middle element as 0 and will be incremented by 1 as it goes out spirally
//eg: n=3
// 4 3 2
// 5 0 1
// 6 7 8
#include<iostream>
#include<cstdlib>
@Codeplaza
Codeplaza / gist:7486314
Created November 15, 2013 15:39
Smiley
#include<iostream>
#include<math.h>
#include<unistd.h>
#include <sys/ioctl.h>
struct winsize w;
using namespace std;
int main()
{
float j;
@Codeplaza
Codeplaza / gist:7486251
Created November 15, 2013 15:35
Roman to Arabic Converter
/*
* This program will convert an Roman number in a Arabic number
* Follows the rules of writing that you can find on: http://en.wikipedia.org/wiki/Roman_numerals#Reading_Roman_numerals
*/
#include <iostream>
using namespace std;
// Array of Arabic number and Roman number
char NumerazioneRomana[7]={'I','V','X','L','C','D','M'};
int AraboCorrispondente[7]={1,5,10,50,100,500,1000};
@Codeplaza
Codeplaza / gist:7486166
Last active December 28, 2015 10:29
1-dimensional Cellular Automata C++‏
#include<iostream>
#include <string>
using namespace::std;
int main(){
const char a = 'X';
const char d = ' ';
@Codeplaza
Codeplaza / gist:7486091
Created November 15, 2013 15:26
Dual Pattern
#include<iostream>
#include<unistd.h>
using namespace::std;
int main(){
int max;
cout<<"Enter number of rows:"<<endl;
cin>>max;
cout<<endl<<endl;
for(int i=1,x=max-1,y=0;i<max&&x>0;i++,x--,y++){
for(int j=1,p=0;j<max;j++,p++,usleep(1000*3)){
@Codeplaza
Codeplaza / gist:7486035
Created November 15, 2013 15:22
Solid Square & Tree Program (User Generated size)‏
/* Project: Tutorial3
* Author: Callum Cooper
* Date: 07/10/2013
* Description: Program uses a main function to take a user generated defined number to
deine the size of a square and calls a drawSquare function to generate the
columns and rows of the square using asterisks.
*/
#include <iostream> // Uses output stream
using namespace std; // C++ standard library declaration
@Codeplaza
Codeplaza / gist:7485851
Created November 15, 2013 15:12
Blokko
/*############################################################################*/
/* BLOCCOGAME */
/*----------------------------------------------------------------------------*/
/* Created on 24/09/2013 by Ali Tugrul PINAR */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* DESCRIPTION */
/*-------------------------
/* This program provides a simulation of a blocco game.
/* Game includes five different difficulty levels.
@Codeplaza
Codeplaza / gist:7472156
Created November 14, 2013 18:44
Basic Calculator
#include "stdafx.h"
#include "string.h"
#include "stdlib.h"
#include "stack.cpp"
#define EXPR_LENGHT 128
#define OPRS "+-*/^"
#define OPE 0
#define OPR 1
#define TEST_STR "(1+3)^2"
#define INT(X) (exp[X]>=48 && exp[X]<=57)
@Codeplaza
Codeplaza / gist:7472021
Created November 14, 2013 18:37
Linked List
#include<dos.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define ESC 27
#define DISPOFFX 50
#define DISPOFFY 2
#define ENDOFX 80
#define ENDOFY 25
#define SPACING 1