hschumann2/TempleOS-Source-Code
0838
1 2#help_index "Misc/TOS/God;God/TOS"3 4U8 *URLPercentSpaces(U8 *src)5{6 U8 buf[2048],*dst=buf;7 while (*src) {8 if (*src==CH_SPACE) {9 *dst++='%';10 *dst++='2';11 *dst++='0';12 src++;13 } else14 *dst++=*src++;15 }16 *dst=0;17 return StrNew(buf);18}19 20U8 *URLPlusSpaces(U8 *src)21{22 U8 buf[2048],*dst=buf;23 while (*src) {24 if (*src==CH_SPACE) {25 *dst++='+';26 src++;27 } else28 *dst++=*src++;29 }30 *dst=0;31 return StrNew(buf);32}33 34I64 ExtDecFromHex(U8 *st,I64 digits)35{36 I64 res=0,ch;37 while (digits) {38 if (!(ch=*st++))39 break;40 if ('0'<=ch<='9') {41 res=10*res+ch-'0';42 digits--;43 }44 }45 return res;46}47 48U0 TOSBookLines(U8 *book_filename,I64 book_lines,U8 *st,I64 num_lines,49 I64 radix,Bool modulo,Bool plus_one)50{//Radix<0 means extract N dec digits from hex.51 CDoc *doc_out,*doc_in;52 CDocEntry *doc_e;53 I64 i,start;54 U8 *verse;55 if (*st && (doc_out=DocPut)) {56 if (radix<0)57 i=ExtDecFromHex(st,-radix);58 else59 i=Str2I64(st,radix);60 if (radix<0)61 DocPrint(doc_out,"'%s'-->(Taking first %d decimal digits)",st,-radix);62 else if (radix==16)63 DocPrint(doc_out,"0x%s-->",st);64 if (modulo) {65 DocPrint(doc_out,"(%d remainder when divided by %d)",66 i,book_lines-(num_lines-1));67 start=i%(book_lines-(num_lines-1));68 } else {69 if (radix>=0 || plus_one)70 DocPrint(doc_out,"%d",i);71 start=i;72 }73 if (plus_one) {74 start++;75 DocPrint(doc_out,"+1");76 }77 DocPrint(doc_out,"-->Line:%d\n",start);78 79 if (StrMatch("NumBible",book_filename)) {80 verse=BibleLine2Verse(start);81 DocPrint(doc_out,"KingJamesBible (%s)\n\nGod says...\n$RED$",verse);82 Free(verse);83 }84 85 doc_in=DocNew;86 BookLines(doc_in,start,num_lines,book_filename);87 while (TRUE) {//Del leading blanks88 doc_e=doc_in->head.next;89 if (doc_e==doc_in)90 break;91 else {92 if (doc_e->type_u8==DOCT_NEW_LINE)93 DocEntryDel(doc_in,doc_e);94 else95 break;96 }97 }98 while (TRUE) {//Del trailing blanks99 doc_e=doc_in->cur_entry->last;100 if (doc_e==doc_in)101 break;102 else {103 if (doc_e->type_u8==DOCT_NEW_LINE)104 DocEntryDel(doc_in,doc_e);105 else106 break;107 }108 }109 DocPrint(doc_in,"$FG$\n");110 DocInsDoc(doc_out,doc_in);111 DocDel(doc_in);112 }113}114 115public U0 GodBooksPassageU32(U32 rand_u32,U8 *files_find_mask,116 U8 *file_mask="*",I64 len=512,I64 verbosity=GBP_MEDIUM)117{//Make God pick a book passage. Holy Spirit Instructions118 CDirEntry *tmpde=FilesFind(files_find_mask,119 FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT),120 *tmpde1,*tmpde2,**tmpde3;121 I64 i=0;122 U8 *st,*st2=NULL;123 124 tmpde3=&tmpde2;125 tmpde2=NULL;126 while (tmpde) {127 tmpde1=tmpde->next;128 if (WildMatch(tmpde->full_name,file_mask)) {129 *tmpde3=tmpde;130 tmpde3=&tmpde->next;131 } else132 DirEntryDel(tmpde);133 tmpde=tmpde1;134 }135 *tmpde3=NULL;136 137 if (tmpde=tmpde2) {138 while (tmpde) {139 st=FileRead(tmpde->full_name);140 tmpde->user_data=StrLen(st);141 if (verbosity==GBP_LONG)142 "%08X-",i;143 if (tmpde->user_data>=len)144 i+=tmpde->user_data+1-len;145 if (verbosity==GBP_LONG)146 "%08X:$LK,\"%s\",A=\"FI:%s\"$\n",147 i-1,tmpde->full_name+2,tmpde->full_name;148 Free(st);149 tmpde=tmpde->next;150 }151 if (verbosity==GBP_LONG)152 '\n';153 if (verbosity>=GBP_MEDIUM)154 "%08X*%08X",rand_u32,i;155 i*=rand_u32;156 if (verbosity>=GBP_MEDIUM)157 "=%08X.%08X\n",i.u32[1],i.u32[0];158 i=i.u32[1];159 160 tmpde=tmpde2;161 while (tmpde) {162 if (!st2 && tmpde->user_data>=len) {163 i-=tmpde->user_data+1-len;164 if (i<0) {165 st=FileRead(tmpde->full_name);166 st2=st+(tmpde->user_data+1-len)+i;167 st2[len]=0;168 "%s\nGod says...\n$RED$%s$FG$\n",tmpde->full_name,st2;169 Free(st);170 }171 }172 tmpde=tmpde->next;173 }174 DirTreeDel(tmpde2);175 }176}177 178U0 GodVideoDigits(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)179{180 U8 *st,*st2;181 CGodVideoForm *gvf=CAlloc(sizeof(CGodVideoForm));182 I64 i=ExtDecFromHex(rnd,digits);183 if (!i) i=Round(10`digits);184 if (st=DocLineRead(filename,i*2+1)) {185 StrCpy(gvf->title,st);186 Free(st);187 if (!(st=DocLineRead(filename,i*2+2))||!*st) {188 Free(st);189 if (DocForm(gvf) && *gvf->serial) {190 if (gvf->min || gvf->sec)191 st=MStrPrint("%s&hl=enUS&start=%d",192 gvf->serial,gvf->min*60+gvf->sec);193 else194 st=StrNew(gvf->serial);195 DocLineWrite(filename,i*2+2,st);196 } else197 st=NULL;198 }199 "'%s'-->(Taking first %d decimal digits) #%02d\n",rnd,digits,i;200 if (StrIMatch("Metallica",filename)) {201 st2=URLPlusSpaces(gvf->title+3);202 "God's response:\n"203 "$TX,\"%s\",HTML=\"%s\"$\n"204 "$TX,\"%s (Lyrics)\","205 "HTML=\"http://lmgtfy.com/?q=Metallica+lyrics+%s\"$\n",206 title,webpage,gvf->title,st2;207 Free(st2);208 } else209 "God's response:\n"210 "$TX,\"%s\",HTML=\"%s\"$\n"211 "#%s\n",title,webpage,gvf->title;212 if (st) {213 "$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"214 "<param name=\\\"movie\\\" "215 "value=\\\"http://www.youtube.com/v/%s\\\"></param><param "216 "name=\\\"allowscriptaccess\\\" "217 "value=\\\"always\\\"></param><embed "218 "src=\\\"http://www.youtube.com/v/%s\\\" "219 "type=\\\"application/x-shockwave-flash\\\" "220 "allowscriptaccess=\\\"always\\\" "221 "width=\\\"640\\\" height=\\\"520\\\">"222 "</embed></object>\"$\n",st,st;223 Free(st);224 }225 }226 Free(gvf);227}228 229U0 GodVideoU32(U32 rand_u32,U8 *filename)230{231 U8 *st,*st2;232 I64 i,num;233 Bool old_silent=Silent;234 num=LineRep(filename,"-S")/2;235 Silent(old_silent);236 if (num) {237 i=rand_u32%num;238 if (st=DocLineRead(filename,i*2+1)) {239 st2=DocLineRead(filename,i*2+2);240 PutFileLink(filename);241 "\nGod's response:\n"242 "%08X-->#%d out of %d\n%s\n",rand_u32,i,num,st;243 "$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"244 "<param name=\\\"movie\\\" "245 "value=\\\"http://www.youtube.com/v/%s\\\"></param><param "246 "name=\\\"allowscriptaccess\\\" "247 "value=\\\"always\\\"></param><embed "248 "src=\\\"http://www.youtube.com/v/%s\\\" "249 "type=\\\"application/x-shockwave-flash\\\" "250 "allowscriptaccess=\\\"always\\\" "251 "width=\\\"640\\\" height=\\\"520\\\">"252 "</embed></object>\"$\n",st2,st2;253 Free(st2);254 Free(st);255 }256 }257}258 259U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)260{261 U8 *st1,*st2;262 I64 i=ExtDecFromHex(rnd,digits);263 if (!i) i=Round(10`digits);264 "'%s'-->(Taking first %d decimal digits) #%02d\n",rnd,digits,i;265 st1=DocLineRead(filename,i*2+1);266 st2=DocLineRead(filename,i*2+2);267 "God's response:\n";268 "$TX,\"%s\",HTML=\"%s\"$\n",title,webpage;269 PutFileLink(filename);270 if (!st1)271 "\n$RED$God does not want to comment.$FG$\n";272 else273 "\n$RED$$TX,\"%s\",HTML=\"%s\"$$FG$\n",st1,st2;274 Free(st1);275 Free(st2);276}277 278U0 GodWordBatch(CHexWordForm *gm,I64 radix,I64 digits)279{//Insert batch of words from rand hex.280 I64 i=0,j,k,min;281 CDirEntry *tmpde,*tmpde1;282 U8 *filename;283 284 FifoU8Flush(god.fifo);285 GodHexIns(gm->rnd0);286 GodHexIns(gm->rnd1);287 GodHexIns(gm->rnd2);288 GodHexIns(gm->rnd3);289 GodHexIns(gm->rnd4);290 GodHexIns(gm->rnd5);291 GodHexIns(gm->rnd6);292 GodHexIns(gm->rnd7);293 GodHexIns(gm->rnd8);294 GodHexIns(gm->rnd9);295 GodHexIns(gm->rndA);296 GodHexIns(gm->rndB);297 298 if (radix==16) {299 tmpde=tmpde1=FilesFind(god.word_file_mask,god.word_fuf_flags);300 while (tmpde) {301 PutFileLink(tmpde->full_name);302 '\n';303 tmpde=tmpde->next;304 }305 DirTreeDel(tmpde1);306 } else {307 if (digits==3)308 filename="::/Home/Sup1/Sup1Blog/NumWords1000.TXT";309 else310 filename="::/Home/Sup1/Sup1Blog/NumWords10k.TXT";311 PutFileLink(filename);312 '\n';313 }314 315 "\n$RED$";316 if (*gm->rnd0)317 "%s\n",gm->rnd0;318 if (*gm->rnd1)319 "%s\n",gm->rnd1;320 if (*gm->rnd2)321 "%s\n",gm->rnd2;322 if (*gm->rnd3)323 "%s\n",gm->rnd3;324 if (*gm->rnd4)325 "%s\n",gm->rnd4;326 if (*gm->rnd5)327 "%s\n",gm->rnd5;328 if (*gm->rnd6)329 "%s\n",gm->rnd6;330 if (*gm->rnd7)331 "%s\n",gm->rnd7;332 if (*gm->rnd8)333 "%s\n",gm->rnd8;334 if (*gm->rnd9)335 "%s\n",gm->rnd9;336 if (*gm->rndA)337 "%s\n",gm->rndA;338 if (*gm->rndB)339 "%s\n",gm->rndB;340 '\n';341 if (radix==16)342 min=digits*4;343 else344 min=4;345 while (FifoU8Cnt(god.fifo)>=min) {346 if (radix==16) {347 j=GodBits(digits*4);348 if (god.num_words) {349 "%02d: %0*X Mod %0*X = %0*X (Line:%0*d):",i++,350 digits,j,digits,god.num_words,digits,j%god.num_words,351 ToI64(Log10(god.num_words)+1),j%god.num_words+1;352 "%s\n",god.words[j%god.num_words];353 }354 } else {355 i=digits;356 j=0;357 do {358 k=GodBits(4);359 if (k<=9) {360 j=j*10+k;361 if (!--i) {362 "%s\n",DocLineRead(filename,j+1);363 break;364 }365 }366 } while (FifoU8Cnt(god.fifo)>=4);367 }368 }369 FifoU8Flush(god.fifo);370 "$FG$\n";371}372 373U0 TOSGodDoodle(I64 god_src,CNISTBeaconHexWordForm *gm=NULL)374{375 CDC *dc;376 Bool old_silent;377 U8 *elems,*hex=CAlloc(sizeof(CNISTBeaconHexWordForm.rnd0)*12);378 if (gm) {379 StrPrint(hex,"%s%s",gm->rnd0,gm->rnd1);380 if (god_src==GSRC_NIST_BEACON) {381 gm->timestamp=FloorI64(CDate2Unix(Now),60);382 if (DocForm(gm(CNISTBeaconHexWordForm *)))383 NISTBeaconURL(gm->timestamp);384 else385 goto gd_done;386 }387 CatPrint(hex,"%s%s",gm->rnd2,gm->rnd3);388 if (god_src==GSRC_NIST_BEACON) {389 gm->timestamp=FloorI64(CDate2Unix(Now),60);390 if (DocForm(gm(CNISTBeaconHexWordForm *)))391 NISTBeaconURL(gm->timestamp);392 else393 goto gd_done;394 }395 CatPrint(hex,"%s%s",gm->rnd4,gm->rnd5);396 if (god_src==GSRC_NIST_BEACON) {397 gm->timestamp=FloorI64(CDate2Unix(Now),60);398 if (DocForm(gm(CNISTBeaconHexWordForm *)))399 NISTBeaconURL(gm->timestamp);400 else401 goto gd_done;402 }403 CatPrint(hex,"%s%s",gm->rnd6,gm->rnd7);404 if (god_src==GSRC_NIST_BEACON) {405 gm->timestamp=FloorI64(CDate2Unix(Now),60);406 if (DocForm(gm(CNISTBeaconHexWordForm *)))407 NISTBeaconURL(gm->timestamp);408 else409 goto gd_done;410 }411 CatPrint(hex,"%s%s",gm->rnd8,gm->rnd9);412 if (god_src==GSRC_NIST_BEACON) {413 gm->timestamp=FloorI64(CDate2Unix(Now),60);414 if (DocForm(gm(CNISTBeaconHexWordForm *)))415 NISTBeaconURL(gm->timestamp);416 else417 goto gd_done;418 }419 CatPrint(hex,"%s%s",gm->rndA,gm->rndB);420 }421 if (elems=GodDoodleSprite(hex)) {422 dc=Sprite2DC(elems);423 BlogDCImgWrite(dc);424 DCDel(dc);425 Free(elems);426 old_silent=Silent;427 FreshenBlog;428 Silent(old_silent);429 }430gd_done:431 Free(hex);432}433 434I64 GodHeaderIns(U8 *type=NULL)435{436 CDateStruct ds;437 I64 res;438 if (type) {//If NISTBeacon439 res=FloorI64(CDate2Unix(Now+2*60*CDATE_FREQ),60);440 Date2Struct(&ds,Unix2CDate(res)+local_time_offset+30*CDATE_FREQ);441 "Response of %s at %02d:%02d Timestamp:%d.\n\n",type,ds.hour,ds.min,res;442 In("%c//Response of %s at %02d:%02d Timestamp:%d.\n\n",443 CH_ESC,type,ds.hour,ds.min,res);444 }445 "$TX,\"Guidelines for Talking with God.\","446 "HTML=\"/Wb/Adam/God/HSNotes.html\"$\n";447 return res;448}449 450U0 TimerGodIns()451{452 U8 buf[STR_LEN];453 GodHeaderIns;454 FifoU8Flush(god.fifo);455 GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);456 switch (PopUpPickLst("Hex5Bible\0Hex8Books\0Doodle\0Movie100\0Painting100\0"457 "Painting1000\0Poems100\0Metallica\0")) {458 case:459 StrPrint(buf,"%05X",GodBits(5*4));460 "$TX,\"How this random Bible passage was chosen.\","461 "HTML=\"/Wb"462 "/Home/Web/TAD/Passage.html\"$\n";463 TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,464 buf,20,16,TRUE,TRUE);465 break;466 case:467 GodBooksPassageU32(GodBits(32),"~/*","C:/Home/Books?/*",,GBP_SHORT);468 break;469 case:470 TOSGodDoodle(GSRC_TIMER);471 break;472 case:473 StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.474 GodVideoDigits("Top 100 Movies",475 "http://www.afi.com/100years/movies10.aspx",476 buf,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");477 break;478 case:479 StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.480 GodWebIdx("Top 100 Paintings",481 "http://www.brushwiz.com/most-famous-paintings",482 buf,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");483 break;484 case:485 StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.486 GodWebIdx("Top 1000 Paintings",487 "http://en.most-famous-paintings.com/MostFamousPaintings."488 "nsf/ListOfTop1000MostPopularPainting",489 buf,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");490 break;491 case:492 StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.493 GodWebIdx("Top 100 Poems",494 "http://100.best-poems.net/top-100-best-poems.html",495 buf,2,"~/Sup1/Sup1Blog/Poems100.DD.Z");496 break;497 case:498 StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.499 GodVideoDigits("Metallica Song",500 "http://home.hccnet.nl/a.r.adams/lyrics/"501 "metallica/songindex.html",502 buf,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");503 break;504 }505}506 507public U0 GodIns()508{//<ALT-F7> Insert misc rand God item into blog.509 U8 *st,*tag;510 CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));511 I64 god_src=PopUpPickLst("NISTBeacon\0HotBits\0ANU_NIST\0Google\0Random.org\0"512 "RandomNumbers.info\0Password\0GenerateData\0VirtualNotary\0Timer\0");513 if (god_src>=GSRC_NIST_BEACON) {514 switch (god_src) {515 case GSRC_NIST_BEACON:516 NISTGodIns1;517 break;518 start:519 case GSRC_HOTBITS:520 tag="https://www.fourmilab.ch/hotbits/secure_generate.html";521 break;522 case GSRC_ANU_NIST:523 tag="http://qrng.anu.edu.au/NIST.php";524 break;525 end:526 GodHeaderIns;527 "$TX,\"%$Q\",HTML=\"%$Q\"$\n",tag,tag;528 switch (PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0"529 "Words1000\0Words10k\0Hex5Bible\0Hex8Books\0Doodle\0Movie100\0"530 "Painting100\0Painting1000\0Poems100\0Metallica\0")) {531 case:532 if (DocForm(gm(CRandExtDec5Form *)))533 TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,534 gm->rnd0,20,-5,FALSE,FALSE);535 break;536 case:537 if (DocForm(gm(CHexWordForm *))) {538 Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");539 GodWordBatch(gm,16,5);540 }541 break;542 case:543 if (DocForm(gm(CHexWordForm *))) {544 Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");545 GodWordBatch(gm,16,5);546 }547 break;548 case:549 if (DocForm(gm(CHexWordForm *)))550 GodWordBatch(gm,10,3);551 break;552 case:553 if (DocForm(gm(CHexWordForm *)))554 GodWordBatch(gm,10,4);555 break;556 case:557 if (DocForm(gm(CRandHex5Form *))) {558 "$TX,\"How this random Bible passage was chosen.\","559 "HTML=\"/Wb"560 "/Home/Web/TAD/Passage.html\"$\n";561 TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,562 gm->rnd0,20,16,TRUE,TRUE);563 }564 break;565 case:566 if (DocForm(gm(CRandHex8Form *))) {567 "$TX,\"How this random book pick was chosen.\","568 "HTML=\"/Wb"569 "/Home/Web/TAD/NISTPick002.html\"$\n";570 GodBooksPassageU32(Str2I64(gm->rnd0,16),571 "~/*","C:/Home/Books?/*");572 }573 break;574 case:575 if (DocForm(gm(CHexWordForm *)))576 TOSGodDoodle(god_src,gm);577 break;578 case:579 if (DocForm(gm(CMoviesForm *)))580 GodVideoDigits("Top 100 Movies",581 "http://www.afi.com/100years/movies10.aspx",582 gm->rnd0,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");583 break;584 case:585 if (DocForm(gm(CPaintings100Form *))) {586 GodWebIdx("Top 100 Paintings",587 "http://www.brushwiz.com/most-famous-paintings",588 gm->rnd0,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");589 }590 break;591 case:592 if (DocForm(gm(CPaintings1000Form *))) {593 GodWebIdx("Top 1000 Paintings",594 "http://en.most-famous-paintings.com/MostFamousPaintings."595 "nsf/ListOfTop1000MostPopularPainting",596 gm->rnd0,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");597 }598 break;599 case:600 if (DocForm(gm(CPoems100Form *))) {601 GodWebIdx("Top 100 Poems",602 "http://100.best-poems.net/top-100-best-poems.html",603 gm->rnd0,2,"~/Sup1/Sup1Blog/Poems100.DD.Z");604 }605 break;606 case:607 if (DocForm(gm(CMetallicaForm *)))608 GodVideoDigits("Metallica Song",609 "http://home.hccnet.nl/a.r.adams/lyrics/"610 "metallica/songindex.html",611 gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");612 break;613 }614 break;615 start:616 case GSRC_GOOGLE:617 tag="http://www.google.com";618 break;619 case GSRC_RANDOM_ORG:620 tag="http://www.random.org";621 break;622 case GSRC_RANDOM_NUMBERS_INFO:623 tag="http://www.randomnumbers.info";624 break;625 case GSRC_PASSWORD:626 tag="https://passed.pw";627 break;628 case GSRC_GENERATE_DATA:629 break;630 end:631 GodHeaderIns;632 "$TX,\"%$Q\",HTML=\"%$Q\"$\n",tag,tag;633 switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0"634 "Hex5Bible\0Hex8Books\0Movie100\0Metallica\0")) {635 case:636 if (DocForm(gm(CRandExtDec5Form *)))637 TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,638 gm->rnd0,20,-5,FALSE,FALSE);639 break;640 case:641 if (DocForm(gm(CHexWordForm *)))642 GodWordBatch(gm,16,5);643 break;644 case:645 if (DocForm(gm(CRandHex5Form *))) {646 "$TX,\"How this random Bible passage was chosen.\","647 "HTML=\"/Wb"648 "/Home/Web/TAD/Passage.html\"$\n";649 TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,650 gm->rnd0,20,16,TRUE,TRUE);651 }652 break;653 case:654 if (DocForm(gm(CRandHex8Form *))) {655 "$TX,\"How this random book pick was chosen.\","656 "HTML=\"/Wb"657 "/Home/Web/TAD/NISTPick002.html\"$\n";658 GodBooksPassageU32(Str2I64(gm->rnd0,16),659 "~/*","C:/Home/Books?/*");660 }661 break;662 case:663 if (DocForm(gm(CMoviesForm *)))664 GodVideoDigits("Top 100 Movies",665 "http://www.afi.com/100years/movies10.aspx",666 gm->rnd0,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");667 break;668 case:669 if (DocForm(gm(CMetallicaForm *)))670 GodVideoDigits("Metallica Song",671 "http://home.hccnet.nl/a.r.adams/lyrics/"672 "metallica/songindex.html",673 gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");674 break;675 }676 break;677 case GSRC_VIRTUAL_NOTARY:678 GodHeaderIns;679 if (DocForm(gm(CCertRandDec5Form *))) {680 tag="http://virtual-notary.org";681 "$TX,\"%$Q\",HTML=\"%$Q\"$\n",tag,tag;682 tag="Here is the certificate";683 st=MStrPrint("/Certs/virtual-notary-cert"684 "-randomnum-%d.p12",gm->cert);685 "\n$TX,\"%$Q: %d\",HTML=\"%$Q\"$.\n",tag,gm->cert,st;686 Free(st);687 TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,688 gm->rnd0,20,-5,FALSE,FALSE);689 }690 break;691 case GSRC_TIMER:692 TimerGodIns;693 break;694 }695 }696 Free(gm);697}698 699if (FileFind("~/Sup1/Sup1Words/LinuxDict.TXT"))700 GodInit("~/Sup1/Sup1Words/LinuxDict.TXT");701//if (FileFind("~/Sup1/Sup1Words/HappyWords.TXT"))702// GodInit("~/Sup1/Sup1Words/HappyWords.TXT");703 