Friday, March 4, 2016

Dimension

Imagine that the entire universe is happening in your head.  Not in such a positivist sense, though, that perhaps experience is nothing more than chemical and electrical signals.  No, consider instead that the totality of your experiences, including every perception and perceived thing, feeling, thought and symbol makes up a universe.  It is YOUR universe.  Nobody else who has ever existed or will exist will see the universe the way you will have seen or experienced it over the course of your life.  Your universe is unique, and is completely contained by your consciousness.  Imagine that every other experiencing subject of life has their own universe, carrying it along with them while they exist.

Imagine that these universes have uniqueness, but can interact with each other.  This would be necessary in order to accept the agency of the actors in our perceptions.  For me to assume that you are actually conscious and a rational agent, you must be in possession of your own universe.  Otherwise you are as a tapestry in the halls of my own.  For us to interact our universes exchange information by some dimensional mechanism.  Consider the permeability then of universes when you observe how many people and things there are experiencing life at the same time.  We are aware of each other, assuming agency, there are many many continual interactions through some manifold of consciousness.

We carry our universe from birth to death.  The impressions from our journey do not disappear, however.  Nor is the universe we inherit at birth completely information-less either.  Consciousness is both an inheritance and endowment, permeating universes and linking them together.

Our normal human perception is restricted to Minkowski space-time.  We can see only cross-sections of our history in synchronization with the "now", like 3rd dimensional "flat-landers".  We see the cross section of a higher dimensional reality as it passes through the manifold to which we are sensitive.  The limits are not absolute though.  This implies the possibility of consciousness traveling through time, within one's own universe.  Would doing so spawn new universes to be inherited?

If all possible histories are laid out on the 5th, then folding through the 6th leads to literal time travel and alternate histories, although still within one's own universe.  Since all possible histories are contained here, this universe is a point in the 7th dimension.  It is an indication of self; the inheritor and experiencing agent of that universe.  Note, although that universe might contain all possible timelines, only choices and interactions with other universes affect the path taken by the agent inception: the self "dreaming itself into the world", while still having a gimped perception restricted to cross sections of the single, determined history.

Alternate universes in the 7th dimension has been explained as those with different initial conditions and physical laws, although without conscious transmission through the manifold, there would be no interaction with these universes.  No indication of their existence.  So we consider alternate universes with similar initial conditions.  These are what we would usually call THE universe just being experienced by different agents.  In fact, each experience is itself its OWN universe as a point in the 7th dimension.  Conscious interaction between agents is a transmission between these points.  Here is how meaning is communicated between agents., how universes change each other and evolve together.  A plane containing all points is the congregation of universes throughout all of time.  New branches are spawned here in this way.  Recall Daath as the 8th, and for us supposedly cannot be crossed: this means we can only be ourselves, we cannot occupy or appropriate another agent's universe, only interact with it at the 7th.  Folding through the 9th would change possession, from one universe to any other within the congregation.  What great power this would take.  Finally, all possible universes and possessions thereof are singly contained by consciousness itself.

This is, of course, all bullshit probably.

Thursday, February 11, 2016

sudoku in C

//not perfect, but a fun start
//have file 'sudoku114.txt' in working directory
//contains 9x9 starting condition for puzzle, ie:

/*
020600005
589240000
310000704
407090218
000000000
260005300
000109060
172560803
090830471
*/

#include <stdio.h>
#include <stdlib.h>

struct sudoku
{
    int puzzle[9][9];
    int iteration;
    struct sudoku* next;
    struct sudoku* prev;
};

struct sudoku *Head;
struct sudoku *Ref;
struct sudoku *New;
struct sudoku *Back;

char Filename[15] = "sudoku114.txt";
int avail[9];
int TOTAL,cheat;

int AvailSum()
{
    int p,sum = 0;
    for(p=0; p<9; p++)
        sum += avail[p];
    return sum;
};

void FindAvailables(int r, int c)
{
    int i,j,n,m;
    for(i=0; i<9; i++)  //init available
        avail[i] = 1;
    for(i=0; i<9; i++)  //elim availables
        if(Ref->puzzle[r][i]>0)
            avail[Ref->puzzle[r][i]-1] = 0;  //along row
    for(j=0; j<9; j++)
        if(Ref->puzzle[j][c]>0)
            avail[Ref->puzzle[j][c]-1] = 0;  //along column
    n = 3*(r/3); m = 3*(c/3);
    for(i=n; i<3+n; i++)
        for(j=m; j<3+m; j++)
            if(Ref->puzzle[i][j]>0)
                avail[Ref->puzzle[i][j]-1] = 0;  //within group
};

void PrintPuzzle()
{
    int r,c;
    TOTAL = 0;
    printf("\n-Iteration %d-\n\n",Ref->iteration);
    printf("   012 345 678\n");
    for(r=0; r<9; r++)
    {
        if(r%3==0) printf("\n");
        printf("%d ",r);
        for(c=0; c<9; c++)
        {
            if(c%3==0) printf(" ");
            printf("%d",Ref->puzzle[r][c]);
            TOTAL += Ref->puzzle[r][c];
        } printf("\n");
    }
   
    if(TOTAL==405)
    {
        printf("\n************\n* YOU WON! *\n************\n");
        exit(EXIT_SUCCESS);
    }
};

void Hints()  //find the # avails for each cell, report list
{
    int a=0,r,c,i,j,k,m,n,p=1;   //format: [r,c] : (avails)

    printf("\nHINTS\n");
    while(p<10)  //change to higher numbers for larger avail lists
    {
        printf("\nAVAIL-%d CELLS\n",p);
        for(r=0; r<9; r++)
        {
            for(c=0; c<9; c++)
            {
                if(Ref->puzzle[r][c]==0)  //find availabilities for non-occupied cells only
                {
                    FindAvailables(r,c);
                    if(AvailSum()==p)
                    {
                        a++;
                        printf("[%d %d]:(",r,c);
                        for(k=0; k<9; k++)   
                        {
                            if(avail[k]>0)
                            {
                                printf("%d ",k+1);
                                if(p==1 && cheat==1)
                                    Ref->puzzle[r][c] = k+1;  //input "9 11" autofills avail-1 cells
                            }
                        }
                        printf("\b)\n");
                    }
                }
            }
        } p++;
    }
    PrintPuzzle();
    if(!a)
    {
        printf("\nNO AVAIL-1 CELLS REMAIN\n");
        if(cheat) cheat = 0;
    }
};

int main()
{
    Head = (struct sudoku*)malloc(sizeof(struct sudoku));
   
    if(Head==NULL)
    { printf("CANT MAKE HEAD NODE"); exit(EXIT_FAILURE); }
   
    Head->next = NULL;
    Head->prev = NULL;
    Head->iteration = 0;  //Head will store the initial read-in from file

    FILE *fptr;
    fptr = fopen(Filename,"r");
    if(fptr==NULL)
    {
        printf("\nUnable to access file \"%s\".\n",Filename);
        printf("Please ensure it exists in working directory\n\n");
        printf("Program Terminated...\n\n");
        exit(EXIT_FAILURE);
    }
   
    int row=0,col=0,entry,i,j,n,m,c;
    while((c = fgetc(fptr)-48)!=EOF)
    {
        if(c!=-38) Head->puzzle[row][col++] = c;  //sep col++?
        if(col>8)
        { col = 0; row++; }
        if(row>8) break;
    }
   
    fclose(fptr);
    Ref = Head;
   
bkup:
    PrintPuzzle();
   
    do
    {
        printf("\n(9 9 = HINTS)\n(9 11 = AUTOSOLVE)\n\n(row col): ");
        scanf("%d %d",&row,&col);
       
        if(row==9 && col==9) Hints();
        else if(row==9 && col==11)
        { cheat = 1; while(cheat) Hints(); cheat = 0; }
        else if(row>8 || col>8) printf("\nOut of Range\n");
        else if(Ref->puzzle[row][col]) printf("\nOccupied\n");
        else
        {
            FindAvailables(row,col);
           
            if(!AvailSum())
            {
                printf("** -- DEADLOCKED -- **\nIteration: %d",Ref->iteration);
                printf("\nBack up how many steps: ");
                scanf("%d",&entry);
               
                if(entry>Ref->iteration) entry = 0;
                else entry = (Ref->iteration)-entry;
               
                while((Ref->iteration)>entry)
                { Back = Ref->prev; Back->next = NULL; free(Ref); Ref = Back; }
                goto bkup;
            }
           
            printf("\nAvailable: (");
            for(i=0; i<9; i++)
                if(avail[i])
                    printf("%d ",i+1);
            printf("\b)");
                   
            printf("\nEntry(0 QUITS): ");
            scanf("%d",&entry);
            if(!avail[entry-1])
                printf("\"%d\" NOT AVAILABLE",entry);
           
            else
            {
                New = (struct sudoku*)malloc(sizeof(struct sudoku));
                if(New==NULL)
                    return 1;
                *New = *Ref;
                New->puzzle[row][col] = entry;
                New->iteration = (Ref->iteration)+1;
                New->next = NULL;
                New->prev = Ref;
                Ref->next = New;
                Ref = New;
                PrintPuzzle();
            }
        }
    } while(entry > 0);
   
    return 0;
}