#include "Control_Include.h"
#include "Cray_Protos.c"

struct          List            Main_List;
struct          Remember        *General_Memory;
struct          Remember        *List_Memory;

void Print_Routine( char *Input, int Colour)
{  
  struct Node *Node_Pointer;
  char *Text_Copy;
  Text_Copy    = AllocRemember(&List_Memory,100,MEMF_ANY);
  if(!Text_Copy)Problem("Failed To Allocate 100 bytes For A Copy",0);
  strcpy(Text_Copy,Input);
  Node_Pointer = AllocRemember(&List_Memory,sizeof(struct Node),MEMF_ANY);  
  if(!Node_Pointer)Problem("Failed To Allocate Enough Memory For A Node",0);
  Node_Pointer->ln_Name=Text_Copy;
  AddTail(&Main_List,Node_Pointer);
 
                    
}

struct Node * List_View_Location(int Index)
{
    struct Node *First_Node;
    struct Node *Second_Node;
    int Counter=0;
    
    First_Node = Main_List.lh_Head;                 // This Now Has The First Node In The List
    for(Counter=1;Counter<=Index;Counter++)
         {
           Second_Node = First_Node->ln_Succ; 
           if(Counter==Index) return(Second_Node);
           Counter++;
           First_Node = Second_Node->ln_Succ;
           if(Counter==Index) return(First_Node);
         }
    return(0);
}    
 
void Clear_List_View( void )
{
    struct Node *Dummy_Node;
    if(!IsListEmpty(&Main_List))
      {
        Dummy_Node = RemHead(&Main_List);
        while(Dummy_Node!=0)
          {  
            Dummy_Node = RemHead(&Main_List);  /* Clear The List */
          }
        FreeRemember(&List_Memory,TRUE);  /* Free The Memory For The Nodes */
        NewList(&Main_List);
      }
      
}


void Free_Memory( void )
{
   AllocRemember(&General_Memory,20,MEMF_ANY);  // To Avoid Crashing!
   FreeRemember(&General_Memory,TRUE);          
}



void Information( void )
{
Print_Routine("                 ______:____:___________________________________________________                  ",1);
Print_Routine("                 \______    |    ______    ______    _____    _______     _____/                  ",1);
Print_Routine("                  |    |    |    |____|    |____|    __]_______   \ \______  \                    ",1);
Print_Routine("                  |    _    |    |    |    |    |         \        \[         \                   ",1);
Print_Routine("                  |    |    |    |    |    |    |         /         \       tP!\                  ",1);
Print_Routine("                  |    |----'    _____|    _____|    ____/    ______/    ______/                  ",1);
Print_Routine("                  `----'    `----'    `----'    `----'   `----'     `----'                        ",1);
Print_Routine("                 x×X×x×X×x cALL tHESE -*- ACCESS -*- bOARDS wORLD wIDE x×X×x×X×x                  ",1);
Print_Routine("                 ×  [WHQ]  Psychokinesis..............[Node#1] +1 318 463 0129 ×                  ",1);
Print_Routine("                 x  [WHQ]  Psychokinesis..............[Node#2] +1 318 462 1856 x                  ",1);
Print_Routine("                 ×  [WHQ]  Psychokinesis..............[Node#3] +1 318 462 6706 ×                  ",1);
Print_Routine("                 x [USHQ]  Paranor....................[nODE#1] +1 318 463 6278 x                  ",1);
Print_Routine("                 × [USHQ]  The Black Hole.............[nODE#1] +1 801 571 4152 ×                  ",1);
Print_Routine("                 x         Dark Tower.................[node#1] +1 801  47 6906 x                  ",1);
Print_Routine("                 x  [CHQ]  Red Light District.........[Node#1] +1 905 508 7356 x                  ",1);
Print_Routine("                 x                                             +1 905 508 4971 x                  ",1);
Print_Routine("                 x [SWYS]  Mental Hangover............[nODE#1] +41 81 771 5253 x                  ",1);
Print_Routine("                 × [UKHQ]  The Egde of Chaos..........[nODE#1] +44 41 644 5588 x                  ",1);
Print_Routine("                 x [DKHQ]  Northen Palace.............[nODE#1] +45  3 961 9420 x                  ",1);
Print_Routine("                 x                                    [node#2] +45  3 961 9421 x                  ",1);
Print_Routine("                 ×  [SHQ]  Hall of Fame...............[nODE#1] +46  9 102 6665 ×                  ",1);
Print_Routine("                 x  [NhQ]  EveryWhere.................[nODE#1] +47  6 395 4190 x                  ",1);
Print_Routine("                 x  [NhQ]  Checkpoint.................[nODE#1] +47  5 159 3123 x                  ",1);
Print_Routine("                 x                                    [Node#2] +47  5 159 2430 x                  ",1);
Print_Routine("                 x×X×x×X×x×X×x×X×x×X×x×X×x×X×xx×X×x×X×x×X×x×X×x×X×xx×X×x×X×x×X×x                  ",1);
Print_Routine("                 X      cALL tHIS kEWL bOARDS fOR wAREZ & mEGAPHUN!!           X                  ",1);
Print_Routine("                 x×X×x×X×x×X×x×X×x×X×x×X×x×X×xx×X×x×X×x×X×x×X×x×X×xx×X×x×X×x×X×x                  ",1);    
}
  
