I hereby claim:
- I am csamu on github.
- I am csamu (https://keybase.io/csamu) on keybase.
- I have a public key whose fingerprint is 5783 1864 2571 48F5 E54D A581 C447 A54C B82E A5A0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
There are different houses in this task. Inside the house there are rooms with walls separating the rooms. A wall can be destroyed anywhere in the house and hence combine the 2 adjacent rooms into 1 room; like opening a door.
Which 2 adjacent rooms can be combined to create the largest room possible?
There are 4 different houses: house1.txt, house2.txt, house3.txt and house4.txt. The first line in a house file states the height of the house, the second line states the width of the house.
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
static const short BOARDSIZE = 5; | |
static const short PIECE[4][2][2] = {{{0,1},{1,1}},{{1,0},{1,1}},{{1,1},{0,1}},{{1,1},{1,0}}}; | |
static int CHECKSUMS[1000][8]; //Har plats för 100 lösningar för varje start-pusselbit | |
static int CHECKSUM_COUNTER = 0; |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define BLACK 1 | |
#define WHITE 15 | |
struct BRICK_MOVE { | |
int color; | |
int from; |
#include <stdlib.h> | |
#include <stdio.h> | |
int brade[11][11]; | |
int losning[32][6]; //Uppgiften är troligen att fylla denna och skriva ut till fil | |
//Skapar brädet enligt figuren | |
void init(void){ | |
int i,j; | |
for(i=0;i<=10;i++) |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct namntyp{ | |
char namn[10]; | |
struct namntyp *nasta; | |
}namntyp; | |
void laes_in(namntyp **l1,char filnamn[]){ |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <string.h> | |
void BitStr(char *str, int k, int n){ | |
float p2 = pow(2, n); | |
int b = k < n * p2; // Kollar om den ska snurra vidare (sant/falskt) | |
int c = (n+1)-((k % n) + 1); //Vart den är i binärtalet (n .. 1) | |
int and = (int)pow(2, c-1); //Vilket tal den ska AND'a (basen 2) |
public void printTruthTable() throws AllInputsNotDefinedException { | |
//Sparar | |
List<OutputCalculator> saved = new ArrayList<OutputCalculator>(inputs); | |
int numinputs = numberOfInputs(); | |
System.out.println("Truthtable, " + this.getClass().getSimpleName()); | |
for(int row=0; row < (int)Math.pow(2, numinputs); row++){ | |
inputs.clear(); | |
for(int pos = numinputs; pos > 0; pos--){ |