{ HYPNOMAP VERSION 1.0 - A SELF HYPNOSIS, MIND MAPPING & SPEED READING AID} { Copyright (C) 1995 Steve Murray remrem This program is free software; you} {can redistribute it and/or modify } { it under the terms of the GNU General Public License as published by } { the Free Software Foundation; either version 1, or (at your option)} { any later version. } { This program is distributed in the hope that it will be useful, } { but WITHOUT ANY WARRANTY; without even the implied warranty of} { MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the } { GNU General Public License for more details. } { You should have received a copy of the GNU General Public License} { along with this program; if not, write to the Free Software } { Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. } { The author can always be contacted at the address} { 51 Turret Road, Knightswood, Glasgow G13 2HQ, Scotland, Great Britain } { or (not guaranteed) via electronic mail, currently (June 1995) } { murrays@dcs.gla.ac.uk or 8736191m@udcf.gla.ac.uk } { Alternatively refer to the usenet newsgroup alt.hypnosis.} { You are encouraged to develop and enhance the program and to distribute } { it. Whilst money is not sought by the author feedback and information } { certainly are - you are encouraged to send the author any information } { you can to do with hypnosis, NLP, mind-mapping, speed-reading etc. } { I am particulary keen to receive other people's computer mind-maps, } { either created with this program or the excellent INFO MAP or } { MIND MAP PLUS programs (Trademarks acknowledged.) } { Most importantly of all I am extremely keen to receive comments and } { ideas on the program itself, it's usefulness and development possibilities,} { porting it to other platforms (please do!) and enhancing it's effectiveness.} { suggestion module files, phrase files, map files, speed read input files,} {anything and everything is most welcome. I am particularly keen to acquire} { mind-maps people have created of popular psychology and self-help books,} { particularly the contents and section headings, which can often be} { highly useful and idea-stimulating without one even having to read the} { book. Should anyone want to send money in support of the program, in } { the interests of netiquette I would prefer if you sent books or information} { files instead - since that is what I would do with it anyway. } PROGRAM BUILDMAP; CONST MAXLINES=21; WORDSINMAP=17; VAR F:TEXT; SUGFILE:TEXT; LINE:INTEGER; {used by readmapline as a counting variable} CHOICE:CHAR; {holds users choice of file or keyboard input} OUTFILE:TEXT; MAPOUTFILE:TEXT; LETTSARRAY:ARRAY [1..1760] OF CHAR; COPYARRAY:ARRAY[1..1760] OF CHAR; SUGWORDFILE:TEXT; rawwordfile:TEXT; WORDFILE:TEXT; FORMINFILE:TEXT; FORMOUTFILE:TEXT; MAPNAME:STRING; PROCEDURE REFORMAT; VAR WORDSTRING:STRING; {turns a word file entered in sequential format into the correct format} BEGIN ASSIGN(FORMINFILE,'wordfile.txt'); RESET(FORMINFILE); ASSIGN (FORMOUTFILE,'wordtemp.txt'); REWRITE(FORMOUTFILE); WRITELN(FORMOUTFILE,'dumyword'); READLN(FORMINFILE, WORDSTRING); END; {procedure is bogus, not finished or coherent} PROCEDURE INPUTSUGS; VAR WORDSTRING:STRING; WORDNO:INTEGER; BEGIN CLS; WRITELN('Please enter your map words one per line'); WRITELN('Please terminate by entering Q'); WHILE (WORDSTRING[1] <>'Q') DO BEGIN READLN(WORDSTRING); FOR WORDNO:=1 TO 100 DO WRITELN(WORDFILE,WORDSTRING); END;{while} END;{inputsugs} PROCEDURE MAKEWORDFILE; VAR WORDSTRING:STRING; WORDNO:INTEGER; BEGIN CLS; WRITELN('Please enter your map words as prompted'); WRITELN('Please ensure they are all 8 characters or padded with - chars'); WRITELN(' Words should be entered left to right, down the page '); WRITELN(' The map title is word no 9 '); WRITELN(WORDFILE,'dumyword'); FOR WORDNO:=1 TO WORDSINMAP DO BEGIN WRITELN('PLEASE ENTER WORD NO ', WORDNO); READLN(WORDSTRING); WRITELN(WORDFILE,WORDSTRING); END;{while} END;{inputsugs} PROCEDURE INITIALISE; VAR COUNT1,COUNT2:INTEGER; BEGIN FOR COUNT1:=1 TO 80 DO BEGIN FOR COUNT2:=1 TO MAXLINES DO BEGIN LETTSARRAY[COUNT2*80+COUNT1]:=' '; COPYARRAY[COUNT2*80+COUNT1]:=' '; END; END; END; PROCEDURE CONVERTCHAR(VAR CH:CHAR); VAR CODE:INTEGER; DIFF:INTEGER; BEGIN IF CH IN ['A'..'Z'] THEN BEGIN CODE:=ORD(CH); DIFF:=ORD('A')-ORD('a'); CODE:=CODE-DIFF; CH:=CHR(CODE); end; END; PROCEDURE READMAPLINE(VAR MAPLINE:STRING); VAR COUNT:INTEGER; BEGIN READLN(F,MAPLINE); FOR COUNT:=1 TO 80 DO BEGIN CONVERTCHAR(MAPLINE[COUNT]); IF MAPLINE[COUNT]='0' THEN MAPLINE[COUNT]:=' '; LETTSARRAY[80*LINE+COUNT]:=MAPLINE[COUNT]; COPYARRAY[80*LINE+COUNT]:=MAPLINE[COUNT]; END; END; FUNCTION ISCHAR(LETTER:CHAR):BOOLEAN; BEGIN ISCHAR:=FALSE; IF ((LETTER IN ['A'..'Z']) OR (LETTER IN ['a'..'z']) OR (LETTER IN ['0' .. '9'])) OR ((LETTER="'") OR (LETTER='-') OR (LETTER ='.')) THEN ISCHAR:=TRUE; END; PROCEDURE GETSUG; VAR SUGGSTRING:STRING; LETTERNO:INTEGER; LETSTRING:STRING; REPLACED:BOOLEAN; BEGIN REPLACED:=FALSE; FOR LETTERNO:=1 TO 1760 DO BEGIN; LETSTRING[1]:=COPYARRAY[LETTERNO]; LETSTRING[0]:=CHR(1); REPLACED:=FALSE; IF (ISCHAR(COPYARRAY[LETTERNO])) THEN BEGIN CONCAT(SUGGSTRING,LETSTRING); REPLACED:=TRUE; END ELSE IF (NOT ISCHAR(COPYARRAY[LETTERNO])) THEN BEGIN IF LENGTH(SUGGSTRING) > 1 THEN WRITELN(SUGWORDFILE,SUGGSTRING); SUGGSTRING:=''; END; IF (REPLACED OR (COPYARRAY[LETTERNO]='-')) THEN COPYARRAY[LETTERNO]:='@'; END; {for} END; {procedure} PROCEDURE PUTBACKSUGG; VAR SUGGSTRING:STRING; LETTERNO:INTEGER; LETSTRING:STRING; REPLACED:BOOLEAN; FILELET:CHAR; PREVCHAR:BOOLEAN; FIRSTCHAR:BOOLEAN; FIRSTWORD:BOOLEAN; BEGIN REPLACED:=FALSE; FILELET:=' '; FIRSTCHAR:=FALSE; PREVCHAR:=FALSE; FIRSTWORD:=TRUE; FOR LETTERNO:=1 TO 1760 DO BEGIN; LETSTRING[1]:=FILELET; LETSTRING[0]:=CHR(1); REPLACED:=FALSE; IF ((COPYARRAY[LETTERNO])='@') THEN BEGIN {put back a word} FIRSTCHAR:=NOT(PREVCHAR); {tell if this is the first letter} PREVCHAR:=TRUE; {set prevchar for next letter} IF NOT FIRSTWORD THEN BEGIN IF (FIRSTCHAR) THEN READLN(rawwordfile); {get past end of line for next word} END ELSE BEGIN WRITELN('FIRSTWORD IS TRUE'); READLN; END;{else} READ(rawwordfile,FILELET); WRITE(FILELET); COPYARRAY[LETTERNO]:=FILELET; REPLACED:=TRUE; END{if} ELSE IF (NOT (COPYARRAY[LETTERNO]='@')) THEN BEGIN PREVCHAR:=FALSE; END; {set prevchar so there will be a readln in the input file next time} FIRSTWORD:=FALSE; END; {for} END; {procedure} PROCEDURE READFILE; VAR LINESTRING:STRING; BEGIN FOR LINE:=1 TO MAXLINES DO BEGIN READMAPLINE(LINESTRING); END; END; PROCEDURE WRITEFILE; VAR LINESTRING:STRING; LETTER:INTEGER; BEGIN CURSOR(0,0); FOR LINE:=1 TO MAXLINES DO BEGIN FOR LETTER:=1 TO 79 DO BEGIN WRITE(COPYARRAY[LINE*80+LETTER]); END; WRITELN; END; END; PROCEDURE WRITEMAP; VAR LINESTRING:STRING; LETTER:INTEGER; BEGIN CURSOR(0,0); FOR LINE:=1 TO MAXLINES DO BEGIN FOR LETTER:=1 TO 79 DO BEGIN WRITE(COPYARRAY[LINE*80+LETTER]); WRITE(MAPOUTFILE,COPYARRAY[LINE*80+LETTER]); END; WRITELN; WRITELN(MAPOUTFILE); END; END; PROCEDURE INVERT; VAR LINESTRING:STRING; LETTER:INTEGER; BEGIN FOR LINE:=1 TO (MAXLINES/2-1) DO BEGIN FOR LETTER:=1 TO 80 DO BEGIN LINESTRING[LETTER]:=LETTSARRAY[LINE*80+LETTER]; IF LINESTRING[LETTER]='/' THEN LINESTRING[LETTER]:='\' ELSE IF LINESTRING[LETTER]='\' THEN LINESTRING[LETTER]:='/'; COPYARRAY[(MAXLINES-LINE+1)*80+LETTER]:=LINESTRING[LETTER]; END; END; LETTSARRAY:=COPYARRAY; END;{procedure} BEGIN ASSIGN (SUGFILE,'suggline.txt'); ASSIGN (F,'inmap.txt'); ASSIGN (SUGWORDFILE,'sugword.out'); ASSIGN (rawwordfile,'suggstwo.sug'); ASSIGN (WORDFILE,'wordfile.txt'); RESET (F); RESET(SUGFILE); RESET(rawwordfile); REWRITE(SUGWORDFILE); WRITELN('Default words will come from wordfile.txt'); WRITELN('One per line, eight chars padded with - chars, and the map name'); WRITELN('as the ninth word'); WRITELN('DO you want to input words manually?'); READLN(CHOICE); IF (CHOICE='Y') OR (CHOICE = 'y') THEN BEGIN REWRITE(WORDFILE); MAKEWORDFILE; END;{then} READFILE; {WRITEFILE;} GETSUG; {WRITEFILE;} CLOSE(rawwordfile); CLOSE(WORDFILE); ASSIGN(rawwordfile,'wordfile.txt'); RESET(rawwordfile); PUTBACKSUGG; {INVERT;} {WRITEFILE;} {PUTINNUMS;} {WRITEFILE;} {REPLACEWITHTEXT;} {WRITEFILE;} WRITEFILE; WRITELN('Please enter a name for the new map'); READLN(MAPNAME); CONCAT (MAPNAME,'.MAP'); ASSIGN (MAPOUTFILE,MAPNAME); REWRITE(MAPOUTFILE); WRITEMAP; END.;