Skip to content

Instantly share code, notes, and snippets.

View metrafonic's full-sized avatar
🌴
On vacation

Mathias metrafonic

🌴
On vacation
View GitHub Profile
@metrafonic
metrafonic / Whatstatus JSON timeline
Created March 4, 2014 13:23
Whatstatus.info v2 api Json format, not yet published
[{
"timestamp": "030320141600",
"status": "0"
}, {
"timestamp": "030320141700",
"status": "0"
}, {
"timestamp": "030320141800",
"status": "0"
}]
@metrafonic
metrafonic / .gitignore
Created March 4, 2014 13:27
Git Ignore file Android Studio
.gradle
/local.properties
/.idea/workspace.xml
.DS_Store
@metrafonic
metrafonic / .travis.yml
Created March 4, 2014 13:28
Travis Build config
language: java
jdk: oraclejdk7
before_install:
# required libs for android build tools
- sudo apt-get update
- sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch
# for gradle output style
- export TERM=dumb
@metrafonic
metrafonic / variables.c
Created September 16, 2014 14:50
C Programming Variables
int main(){
float poop;
int oct;
oct =0x1067;
printf("Demo Integers:\n");
printf("Using: 0x1067\n");
printf("As integer: %i\n", oct);
printf("As oct: %o\n", oct);
printf("As hex: %#x\n", oct);
@metrafonic
metrafonic / oppgave1.c
Created September 17, 2014 09:02
Oppgave1.c
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <conio.h>
int main(){
int x=1;
int y = 1;
int i, j, z, nr1, nr2, nr3, nr4;
@metrafonic
metrafonic / oppgave2.c
Created September 17, 2014 09:03
oppgave2.c
#include <stdio.h>
#include <conio.h>
int main(){
int antallmellom=0, plasser=20, i, j;
for(i=1;i<plasser;i++){
antallmellom=plasser-i;
for(j=1;j<=antallmellom;j++){
printf(" ");
}
for(j=1;j<i;j++){
@metrafonic
metrafonic / oppgave3.c
Created September 17, 2014 09:03
Oppgave3
#include <stdio.h>
#include <conio.h>
int main(){
int c;
float i=10, fact=1;
float e=1;
double factone=1;
double eone=1;
@metrafonic
metrafonic / oppgave4.c
Created September 17, 2014 09:04
Oppgave4
#include <stdio.h>
#include <conio.h>
#include <math.h>
int main(){
int i = 0;
double pi = 1, piresult=0;
int pides=1;
double faktor=0, pi10desimaler=1, pinew=0, piold=0, pidiff=0;
float j =0, stop=0,ipotens=0;
@metrafonic
metrafonic / deal.c
Last active August 29, 2015 14:08
Deal function for a c poker application, will place card values in the array hand parameter.
void deal(int hand[]){
int deck[52]= { 0 };
int i, verdi;
for (i=0;i<5;i++){
verdi = rand() % 52;
while(deck[verdi]==1){
verdi = rand() % 52;
}
hand[i]=verdi;
deck[verdi]=1;
@metrafonic
metrafonic / ispair.c
Created October 26, 2014 13:08
ispair
int isPair(int hand[]){
int i=0,brukteVerdier[13]={0}, antallpar=0, antalltress=0, kort=0;
for (i=0;i<5;i++){
kort = hand[i]%13;
if(brukteVerdier[kort]==1){
antallpar++;
}
if(brukteVerdier[kort]==2){
antalltress++;
}