// Source: D:\TempleOS-Projects\html\BgtAccts-Budget-Apps.html
// Date: unknown-date
// Language: HolyC

U0 BgtAcctsUpdate()
{
  CBgtEntry     *tmpb;
  CBgtTemplate  *tmpt;
  tmpb=b_head.next;
  while (tmpb!=&b_head) {
    if (tmpb->type!=BE_TEMPLATE_COPY) {
      tmpb->credit_idx=StrFileAdd(tmpb->credit,
            &accts_table_strs,accts_table);
      tmpb->debit_idx =StrFileAdd(tmpb->debit,
            &accts_table_strs,accts_table);
    }
    tmpb=tmpb->next;
  }
  tmpt=t_head.next;
  while (tmpt!=&t_head) {
    tmpt->b.credit_idx=StrFileAdd(tmpt->b.credit,
          &accts_table_strs,accts_table);
    tmpt->b.debit_idx =StrFileAdd(tmpt->b.debit,
          &accts_table_strs,accts_table);
    tmpt=tmpt->next;
  }
}

U0 BgtAcctsWrite()
{
  BgtAcctsUpdate;
  StrFileWrite(bgt_accts_file,accts_table,TRUE);
}

U0 BgtAcctsRead()
{
  I64   i,max_num;
  U8    *colors,**s=StrFileRead(bgt_accts_file,&max_num,&colors,TRUE);
  StrFileDel(accts_table);
  accts_table=HashTableNew(512);
  accts_table_strs=0;
  for (i=0;i<=max_num;i++)
    if (s[i])
      StrFileAdd(s[i],&accts_table_strs,accts_table,colors[i]);
  StrFileArrDel(s,max_num);
  Free(colors);
}

I64 BgtAcctColor(U8 *st)
{
  CHashGeneric *tmph;
  if (tmph=HashFind(st,accts_table,SFT_GENERIC))
    return tmph->user_data1;
  else
    return BLACK;
}

U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
{
  I64 i;
  U8 *res;
  CDoc *doc=DocNew;
  CDocEntry *doc_e,*doc_dft=NULL;
  CHashGeneric *tmph;

  if (header)
    DocPrint(doc,"%s",header);

  for (i=0;i<=accts_table->mask;i++) {
    tmph=accts_table->body[i];
    while (tmph) {
      doc_e=DocPrint(doc,"$FG,%d$$MU-UL,\"%s\",LE=0x%X$\n",
            tmph->user_data1,tmph->str,tmph->str);
      if (dft && !StrCmp(dft,tmph->str))
        doc_dft=doc_e;
      tmph=tmph->next;
    }
  }

  if (doc_dft) {
    doc->cur_entry=doc_dft;
    doc->cur_col=0;
  }
  res=PopUpMenu(doc,DOF_DONT_HOME);
  DocDel(doc);
  return res;
}

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\BgtAccts-Budget-Apps.html
// Date: unknown-date
// Language: HolyC

U0 BgtAcctsUpdate()
{
  CBgtEntry     *tmpb;
  CBgtTemplate  *tmpt;
  tmpb=b_head.next;
  while (tmpb!=&b_head) {
    if (tmpb->type!=BE_TEMPLATE_COPY) {
      tmpb->credit_idx=StrFileAdd(tmpb->credit,
            &accts_table_strs,accts_table);
      tmpb->debit_idx =StrFileAdd(tmpb->debit,
            &accts_table_strs,accts_table);
    }
    tmpb=tmpb->next;
  }
  tmpt=t_head.next;
  while (tmpt!=&t_head) {
    tmpt->b.credit_idx=StrFileAdd(tmpt->b.credit,
          &accts_table_strs,accts_table);
    tmpt->b.debit_idx =StrFileAdd(tmpt->b.debit,
          &accts_table_strs,accts_table);
    tmpt=tmpt->next;
  }
}

U0 BgtAcctsWrite()
{
  BgtAcctsUpdate;
  StrFileWrite(bgt_accts_file,accts_table,TRUE);
}

U0 BgtAcctsRead()
{
  I64   i,max_num;
  U8    *colors,**s=StrFileRead(bgt_accts_file,&max_num,&colors,TRUE);
  StrFileDel(accts_table);
  accts_table=HashTableNew(512);
  accts_table_strs=0;
  for (i=0;i<=max_num;i++)
    if (s[i])
      StrFileAdd(s[i],&accts_table_strs,accts_table,colors[i]);
  StrFileArrDel(s,max_num);
  Free(colors);
}

I64 BgtAcctColor(U8 *st)
{
  CHashGeneric *tmph;
  if (tmph=HashFind(st,accts_table,SFT_GENERIC))
    return tmph->user_data1;
  else
    return BLACK;
}

U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
{
  I64 i;
  U8 *res;
  CDoc *doc=DocNew;
  CDocEntry *doc_e,*doc_dft=NULL;
  CHashGeneric *tmph;

  if (header)
    DocPrint(doc,"%s",header);

  for (i=0;i<=accts_table->mask;i++) {
    tmph=accts_table->body[i];
    while (tmph) {
      doc_e=DocPrint(doc,"$FG,%d$$MU-UL,\"%s\",LE=0x%X$\n",
            tmph->user_data1,tmph->str,tmph->str);
      if (dft && !StrCmp(dft,tmph->str))
        doc_dft=doc_e;
      tmph=tmph->next;
    }
  }

  if (doc_dft) {
    doc->cur_entry=doc_dft;
    doc->cur_col=0;
  }
  res=PopUpMenu(doc,DOF_DONT_HOME);
  DocDel(doc);
  return res;
}


// Source: D:\TempleOS-Projects\html\MsgLoop-Demo.html
// Date: unknown-date
// Language: HolyC

U0 MsgLoop()
{
  I64 arg1,arg2,msg_code;
  "Use msg_code defines in your programs instead of hardcoded nums.\n"
        "<ESC> to Exit\n";

  //We don't want the mouse bttns to reposition the cursor,
  //so we inhibit the window mgr from processing them.

  Fs->win_inhibit=WIF_SELF_MS_L|WIF_SELF_MS_R;

  do {
    msg_code=GetMsg(&arg1,&arg2,~(1<<MSG_NULL));
    "CMD:%02X ARG1:%08X ARG2:%016X\n",msg_code,arg1,arg2;
  } while (msg_code!=MSG_KEY_DOWN || arg1!=CH_ESC && arg1!=CH_SHIFT_ESC);
  GetMsg(,,1<<MSG_KEY_UP);

  Fs->win_inhibit=WIG_USER_TASK_DFT;
}

MsgLoop;

// Press <CTRL-SHIFT-L> and "Insert ASCII/ScanCode".

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\MsgLoop-Demo.html
// Date: unknown-date
// Language: HolyC

U0 MsgLoop()
{
  I64 arg1,arg2,msg_code;
  "Use msg_code defines in your programs instead of hardcoded nums.\n"
        "<ESC> to Exit\n";

  //We don't want the mouse bttns to reposition the cursor,
  //so we inhibit the window mgr from processing them.

  Fs->win_inhibit=WIF_SELF_MS_L|WIF_SELF_MS_R;

  do {
    msg_code=GetMsg(&arg1,&arg2,~(1<<MSG_NULL));
    "CMD:%02X ARG1:%08X ARG2:%016X\n",msg_code,arg1,arg2;
  } while (msg_code!=MSG_KEY_DOWN || arg1!=CH_ESC && arg1!=CH_SHIFT_ESC);
  GetMsg(,,1<<MSG_KEY_UP);

  Fs->win_inhibit=WIG_USER_TASK_DFT;
}

MsgLoop;

// Press <CTRL-SHIFT-L> and "Insert ASCII/ScanCode".


// Source: D:\TempleOS-Projects\html\CmdLineOverview-Doc.html
// Date: unknown-date
// Language: HolyC

Command Line Overview

The cmd line feeds into the HolyC compiler line-by-line as you type.  A stmt
outside a function executes immediately.  Remember to add a semicolon.

Look-up the function headers with AutoComplete by hitting <CTRL-SHIFT-F1> after
typing the first few letters.

Click Here to see the directory cmd header.  It accepts default args from C++.

>Dir("*.DD.Z");

If you don't have args, you don't need parenthesis.

>Dir;

Directories are referenced with / not \.  There is a current directory, but not
a path.  To run a program, you typically #include it.  There are several
shortcuts for #includeing files.  Right-click or hit <ENTER> on a directory
listing or press <F5> while editing.

>Ed("NewFile.HC.Z");    Invokes the editor. See Doc Link Type.

Most filenames end in .Z because they are stored compressed.

Drives are specified with a letter.  The boot drive is specified with a ':'.
The home dir drive is specified with a '~'.

>Drv('B');      B drive

The drive can be specified in a Cd() command as in:

>Cd("B:/Tmp");  B drive
>Cd("::/Demo"); Boot drive

The home directory is specified with a '~'.

>Cd("~/Psalmody");      See ::/Home dir.

If a file is not found, .Z is added or removed and a search is done, again.  If
a file is still not found, all parent directories are searched.

You can place macros in your PersonalMenu for Cd() commands.  <CTRL-m> to access
your menu.

>Find("needle","/Demo/*.HC.Z;*.DD.Z;"); See File Utils.

Cmd Line Routines

Take Tour

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\CmdLineOverview-Doc.html
// Date: unknown-date
// Language: HolyC

Command Line Overview

The cmd line feeds into the HolyC compiler line-by-line as you type.  A stmt
outside a function executes immediately.  Remember to add a semicolon.

Look-up the function headers with AutoComplete by hitting <CTRL-SHIFT-F1> after
typing the first few letters.

Click Here to see the directory cmd header.  It accepts default args from C++.

>Dir("*.DD.Z");

If you don't have args, you don't need parenthesis.

>Dir;

Directories are referenced with / not \.  There is a current directory, but not
a path.  To run a program, you typically #include it.  There are several
shortcuts for #includeing files.  Right-click or hit <ENTER> on a directory
listing or press <F5> while editing.

>Ed("NewFile.HC.Z");    Invokes the editor. See Doc Link Type.

Most filenames end in .Z because they are stored compressed.

Drives are specified with a letter.  The boot drive is specified with a ':'.
The home dir drive is specified with a '~'.

>Drv('B');      B drive

The drive can be specified in a Cd() command as in:

>Cd("B:/Tmp");  B drive
>Cd("::/Demo"); Boot drive

The home directory is specified with a '~'.

>Cd("~/Psalmody");      See ::/Home dir.

If a file is not found, .Z is added or removed and a search is done, again.  If
a file is still not found, all parent directories are searched.

You can place macros in your PersonalMenu for Cd() commands.  <CTRL-m> to access
your menu.

>Find("needle","/Demo/*.HC.Z;*.DD.Z;"); See File Utils.

Cmd Line Routines

Take Tour


// Source: D:\TempleOS-Projects\html\doing-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has graphics;

           <1>/* Graphics Not Rendered in HTML */

F64 t0=Beat;
U0 DrawIt(CTask *,CDC *dc)
{
  F64 dt=Beat-t0;
  dc->flags|=DCF_TRANSFORMATION;
  DCDepthBufAlloc(dc);
  dc->x=320;
  dc->y=27;
  dc->z=GR_Z_ALL;
  Mat4x4RotX(dc->r,0.140*pi);
  Mat4x4RotZ(dc->r,0.250*pi*Sin(pi*dt));
  Mat4x4RotY(dc->r,0.230*pi);
  if (dt>16)
    Mat4x4RotY(dc->r,0.5*Sin(pi/2*dt));
  Sprite3(dc,0,0,0,<1>);
}

U0 Song()
{
  SettingsPush; //See SettingsPush
  Fs->draw_it=&DrawIt;
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.902;
  try {
    while (!ScanKey) {
      t0=Beat;
      "$GREEN$To God...$FG$\n";
      Play("5qG4BA5sEDEDqCG4B5C",
            "Fa\0ther, \0 \0what \0 \0 \0 \0You \0been \0do\0ing?\n\0");
      Play("5G4BA5sEDEDqCG4B5C",
            "Watch\0-it!  \0 \0Or, \0 \0 \0 \0they'll \0be \0su\0ing.\n\0");
      Play("5eGDD4B5G4BqB5eE4A5EDFE4qG",
            "They \0don't \0real\0ly \0un\0der\0stand\n\0"
            "What \0 \0You're \0 \0up \0 \0to.\n\0");
      Play("5eGDD4B5G4BqB5eE4A5EDFE4qG",
            "High \0a\0bove \0our \0ways,\n\0 \0 \0If \0 \0"
            "they \0 \0on\0ly \0knew.\n\0");
    }
  } catch
    PutExcept;
  SettingsPop;
}

Song;

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\doing-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has graphics;

           <1>/* Graphics Not Rendered in HTML */

F64 t0=Beat;
U0 DrawIt(CTask *,CDC *dc)
{
  F64 dt=Beat-t0;
  dc->flags|=DCF_TRANSFORMATION;
  DCDepthBufAlloc(dc);
  dc->x=320;
  dc->y=27;
  dc->z=GR_Z_ALL;
  Mat4x4RotX(dc->r,0.140*pi);
  Mat4x4RotZ(dc->r,0.250*pi*Sin(pi*dt));
  Mat4x4RotY(dc->r,0.230*pi);
  if (dt>16)
    Mat4x4RotY(dc->r,0.5*Sin(pi/2*dt));
  Sprite3(dc,0,0,0,<1>);
}

U0 Song()
{
  SettingsPush; //See SettingsPush
  Fs->draw_it=&DrawIt;
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.902;
  try {
    while (!ScanKey) {
      t0=Beat;
      "$GREEN$To God...$FG$\n";
      Play("5qG4BA5sEDEDqCG4B5C",
            "Fa\0ther, \0 \0what \0 \0 \0 \0You \0been \0do\0ing?\n\0");
      Play("5G4BA5sEDEDqCG4B5C",
            "Watch\0-it!  \0 \0Or, \0 \0 \0 \0they'll \0be \0su\0ing.\n\0");
      Play("5eGDD4B5G4BqB5eE4A5EDFE4qG",
            "They \0don't \0real\0ly \0un\0der\0stand\n\0"
            "What \0 \0You're \0 \0up \0 \0to.\n\0");
      Play("5eGDD4B5G4BqB5eE4A5EDFE4qG",
            "High \0a\0bove \0our \0ways,\n\0 \0 \0If \0 \0"
            "they \0 \0on\0ly \0knew.\n\0");
    }
  } catch
    PutExcept;
  SettingsPop;
}

Song;


// Source: D:\TempleOS-Projects\html\KExcept-Kernel.html
// Date: unknown-date
// Language: HolyC

asm {
#assert !((REGG_LOCAL_NON_PTR_VARS|REGG_LOCAL_VARS)&~0xFCC0)
_TEST_EXCEPT::
        XOR     RAX,RAX
        MOV     RAX,FS:U64 CTask.last_except[RAX]
        MOV     RBP,U64 CExcept.rbp[RAX]
        MOV     RSI,U64 CExcept.rsi[RAX]
        MOV     RDI,U64 CExcept.rdi[RAX]
        MOV     R10,U64 CExcept.r10[RAX]
        MOV     R11,U64 CExcept.r11[RAX]
        MOV     R12,U64 CExcept.r12[RAX]
        MOV     R13,U64 CExcept.r13[RAX]
        MOV     R14,U64 CExcept.r14[RAX]
        MOV     R15,U64 CExcept.r15[RAX]
        PUSH    U64 CExcept.rflags[RAX]
        POPFD
        JMP     U64 CExcept.hndlr_catch[RAX]

_TAKE_EXCEPT::
        XOR     RAX,RAX
        MOV     RAX,FS:U64 CTask.last_except[RAX]
        MOV     RSP,U64 CExcept.rsp[RAX]
        JMP     U64 CExcept.hndlr_untry[RAX]

_SAVE_EXCEPT_REGS::
        PUSH    RBP
        MOV     RBP,RSP
        MOV     RAX,U64 SF_ARG1[RBP]
        MOV     U64 CExcept.rsi[RAX],RSI
        MOV     U64 CExcept.rdi[RAX],RDI
        MOV     U64 CExcept.r10[RAX],R10
        MOV     U64 CExcept.r11[RAX],R11
        MOV     U64 CExcept.r12[RAX],R12
        MOV     U64 CExcept.r13[RAX],R13
        MOV     U64 CExcept.r14[RAX],R14
        MOV     U64 CExcept.r15[RAX],R15
        POP     RBP
        RET1    8
}

_extern _TEST_EXCEPT U0 TestExcept();
_extern _TAKE_EXCEPT U0 TakeExcept();
_extern _SAVE_EXCEPT_REGS U0 SaveExceptRegs(CExcept *t);

U0 PutExcept(Bool catch_it=TRUE)
{//Print exception msg and catch exception.
  "Except:%c:",Fs->except_ch;
  "%P:%P:%P:%P:%P:%P\n",Fs->except_callers[0],Fs->except_callers[1],
        Fs->except_callers[2],Fs->except_callers[3],Fs->except_callers[4],
        Fs->except_callers[5],Fs->except_callers[6],Fs->except_callers[7];
  Fs->catch_except=catch_it;
}

#exe {Option(OPTf_NO_REG_VAR,ON);};

class CTryStk
{
  I64 rbp;
  I64 ret_rip;
  I64 arg1;
  I64 arg2;
};

U0 SysTry(U8 *catch_start,U8 *untry_start)
{
  I64 *rbp=GetRBP;
  CExcept *tmpt=MAlloc(sizeof(CExcept));
  tmpt->hndlr_catch=catch_start;
  tmpt->hndlr_untry=untry_start;
  tmpt->rsp=rbp(U8 *)+sizeof(CTryStk);
  tmpt->rbp=*rbp;
  tmpt->rflags=GetRFlags;
  SaveExceptRegs(tmpt);
  QueIns(tmpt,Fs->last_except);
}

U0 SysUntry()
{
  CExcept *tmpt=Fs->last_except;
  QueRem(tmpt);
  Free(tmpt);
}

U0 throw(I64 ch=0,Bool no_log=FALSE)
{//ch can be up to 8 chars like PutChars().
//In the catcher, fetch ch from Fs->except_ch.
  CExcept *tmpt=Fs->last_except;
  Bool was_raw;
  I64 i;
  Fs->except_ch=ch;
  for (i=0;i<TASK_EXCEPT_CALLERS;i++)
    Fs->except_callers[i]=Caller(i+1);
  Fs->except_rbp=GetRBP;
  Fs->catch_except=FALSE;
  if (!no_log)
    AdamLog("Except:%c:%p:%p:%p:%p:%p:%p\n",ch,Fs->except_callers[0],
          Fs->except_callers[1],Fs->except_callers[2],Fs->except_callers[3],
          Fs->except_callers[4],Fs->except_callers[5],Fs->except_callers[6],
          Fs->except_callers[7]);
  while (Fs->next_except!=&Fs->next_except) {
    TestExcept;
    if (Fs->catch_except)
      TakeExcept;
    SetRBP(Fs->except_rbp);
    tmpt=Fs->last_except;
    QueRem(tmpt);
    Free(tmpt);
  }
  was_raw=Raw(ON);
  PutExcept(FALSE);
  Panic("Unhandled Exception");
  Raw(was_raw);
}

#exe {Option(OPTf_NO_REG_VAR,OFF);};

U0 Break()
{//Send <CTRL-ALT-c>.
  if (Bt(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC))
    Msg(MSG_KEY_DOWN,CH_SHIFT_ESC,0x20100000201);
  else {
    Fs->wake_jiffy=0;
    TaskRstAwaitingMsg;
    DrvsRelease();
    BlkDevsRelease();
    FlushMsgs;
    throw('Break');
  }
}

Bool BreakLock(CTask *task=NULL)
{//Disables <CTRL-ALT-c>.
  if (!task) task=Fs;
  return !LBts(&task->task_flags,TASKf_BREAK_LOCKED);
}

Bool BreakUnlock(CTask *task=NULL)
{//Reenables <CTRL-ALT-c> and issues any pending breaks.
  Bool res;
  if (!task) task=Fs;
  res=LBtr(&task->task_flags,TASKf_BREAK_LOCKED);
  if (LBtr(&task->task_flags,TASKf_PENDING_BREAK)) {
    if (task==Fs)
      Break;
    else
      task->rip=&Break;
  }
  return res;
}

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\KExcept-Kernel.html
// Date: unknown-date
// Language: HolyC

asm {
#assert !((REGG_LOCAL_NON_PTR_VARS|REGG_LOCAL_VARS)&~0xFCC0)
_TEST_EXCEPT::
        XOR     RAX,RAX
        MOV     RAX,FS:U64 CTask.last_except[RAX]
        MOV     RBP,U64 CExcept.rbp[RAX]
        MOV     RSI,U64 CExcept.rsi[RAX]
        MOV     RDI,U64 CExcept.rdi[RAX]
        MOV     R10,U64 CExcept.r10[RAX]
        MOV     R11,U64 CExcept.r11[RAX]
        MOV     R12,U64 CExcept.r12[RAX]
        MOV     R13,U64 CExcept.r13[RAX]
        MOV     R14,U64 CExcept.r14[RAX]
        MOV     R15,U64 CExcept.r15[RAX]
        PUSH    U64 CExcept.rflags[RAX]
        POPFD
        JMP     U64 CExcept.hndlr_catch[RAX]

_TAKE_EXCEPT::
        XOR     RAX,RAX
        MOV     RAX,FS:U64 CTask.last_except[RAX]
        MOV     RSP,U64 CExcept.rsp[RAX]
        JMP     U64 CExcept.hndlr_untry[RAX]

_SAVE_EXCEPT_REGS::
        PUSH    RBP
        MOV     RBP,RSP
        MOV     RAX,U64 SF_ARG1[RBP]
        MOV     U64 CExcept.rsi[RAX],RSI
        MOV     U64 CExcept.rdi[RAX],RDI
        MOV     U64 CExcept.r10[RAX],R10
        MOV     U64 CExcept.r11[RAX],R11
        MOV     U64 CExcept.r12[RAX],R12
        MOV     U64 CExcept.r13[RAX],R13
        MOV     U64 CExcept.r14[RAX],R14
        MOV     U64 CExcept.r15[RAX],R15
        POP     RBP
        RET1    8
}

_extern _TEST_EXCEPT U0 TestExcept();
_extern _TAKE_EXCEPT U0 TakeExcept();
_extern _SAVE_EXCEPT_REGS U0 SaveExceptRegs(CExcept *t);

U0 PutExcept(Bool catch_it=TRUE)
{//Print exception msg and catch exception.
  "Except:%c:",Fs->except_ch;
  "%P:%P:%P:%P:%P:%P\n",Fs->except_callers[0],Fs->except_callers[1],
        Fs->except_callers[2],Fs->except_callers[3],Fs->except_callers[4],
        Fs->except_callers[5],Fs->except_callers[6],Fs->except_callers[7];
  Fs->catch_except=catch_it;
}

#exe {Option(OPTf_NO_REG_VAR,ON);};

class CTryStk
{
  I64 rbp;
  I64 ret_rip;
  I64 arg1;
  I64 arg2;
};

U0 SysTry(U8 *catch_start,U8 *untry_start)
{
  I64 *rbp=GetRBP;
  CExcept *tmpt=MAlloc(sizeof(CExcept));
  tmpt->hndlr_catch=catch_start;
  tmpt->hndlr_untry=untry_start;
  tmpt->rsp=rbp(U8 *)+sizeof(CTryStk);
  tmpt->rbp=*rbp;
  tmpt->rflags=GetRFlags;
  SaveExceptRegs(tmpt);
  QueIns(tmpt,Fs->last_except);
}

U0 SysUntry()
{
  CExcept *tmpt=Fs->last_except;
  QueRem(tmpt);
  Free(tmpt);
}

U0 throw(I64 ch=0,Bool no_log=FALSE)
{//ch can be up to 8 chars like PutChars().
//In the catcher, fetch ch from Fs->except_ch.
  CExcept *tmpt=Fs->last_except;
  Bool was_raw;
  I64 i;
  Fs->except_ch=ch;
  for (i=0;i<TASK_EXCEPT_CALLERS;i++)
    Fs->except_callers[i]=Caller(i+1);
  Fs->except_rbp=GetRBP;
  Fs->catch_except=FALSE;
  if (!no_log)
    AdamLog("Except:%c:%p:%p:%p:%p:%p:%p\n",ch,Fs->except_callers[0],
          Fs->except_callers[1],Fs->except_callers[2],Fs->except_callers[3],
          Fs->except_callers[4],Fs->except_callers[5],Fs->except_callers[6],
          Fs->except_callers[7]);
  while (Fs->next_except!=&Fs->next_except) {
    TestExcept;
    if (Fs->catch_except)
      TakeExcept;
    SetRBP(Fs->except_rbp);
    tmpt=Fs->last_except;
    QueRem(tmpt);
    Free(tmpt);
  }
  was_raw=Raw(ON);
  PutExcept(FALSE);
  Panic("Unhandled Exception");
  Raw(was_raw);
}

#exe {Option(OPTf_NO_REG_VAR,OFF);};

U0 Break()
{//Send <CTRL-ALT-c>.
  if (Bt(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC))
    Msg(MSG_KEY_DOWN,CH_SHIFT_ESC,0x20100000201);
  else {
    Fs->wake_jiffy=0;
    TaskRstAwaitingMsg;
    DrvsRelease();
    BlkDevsRelease();
    FlushMsgs;
    throw('Break');
  }
}

Bool BreakLock(CTask *task=NULL)
{//Disables <CTRL-ALT-c>.
  if (!task) task=Fs;
  return !LBts(&task->task_flags,TASKf_BREAK_LOCKED);
}

Bool BreakUnlock(CTask *task=NULL)
{//Reenables <CTRL-ALT-c> and issues any pending breaks.
  Bool res;
  if (!task) task=Fs;
  res=LBtr(&task->task_flags,TASKf_BREAK_LOCKED);
  if (LBtr(&task->task_flags,TASKf_PENDING_BREAK)) {
    if (task==Fs)
      Break;
    else
      task->rip=&Break;
  }
  return res;
}


// Source: D:\TempleOS-Projects\html\Paintings1000-Sup1-Sup1Blog-Home.html
// Date: unknown-date
// Language: HolyC

#001 Leonardo Da Vinci - 'Mona Lisa (La Gioconda)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYFFG
#002 Vincent Van Gogh - 'Starry-Night'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG47
#003 Edvard Munch - 'The Scream'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XXU4K
#004 Pablo Picasso - 'Three Musicians'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKDK5
#005 Jan Vermeer - 'The Girl with a Pearl Earring'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYC2C
#006 Rembrandt Van Rijn - 'Night Watch'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDJKC
#007 Gustav Klimt - 'The Kiss (Bacio)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCLN
#008 Claude Monet - 'Water Lilies'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8EWENT
#009 Georges Pierre Seurat - 'A Sunday Afternoon on the Island of La Grande Jatte'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YE42F
#010 Grant Wood - 'American Gothic'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XY5W5
#011 James Abbott Mcneill Whistler - 'Arrangement in Grey and Black. Portrait of the Painter's Mother'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8EWK3Z
#012 Vincent Van Gogh - 'Caf.. Terrace at Night'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG53
#013 Rene Magritte - 'The Son of Man'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYU67
#014 Pierre-Auguste Renoir - 'Dance at Moulin de la Galette'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYRLQ
#015 Edouard Manet - 'Olympia, Musee d'Orsay, Paris'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=9H5RBK
#016 Rene Magritte - 'Time transfixed'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKEMD
#017 Pablo Picasso - 'Les Demoiselles d'Avignon'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKH5G
#018 Caspar David Friedrich - 'The Sea of Ice'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=7YXQM8
#019 Francisco De Goya - 'Saturn Devouring His Son'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XY39P
#020 Michelangelo Buonarroti - 'Creation of Adam'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XZMGJ
#021 Vincent Van Gogh - 'Vincent's Bedroom in Arles'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKGVY
#022 Francisco De Goya - 'The Third of May 1808 (Execution of the Defenders of Madrid)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XY37T
#023 Vincent Van Gogh - 'The Night Cafe [1888]'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG2F
#024 Vincent Van Gogh - 'Cafe Terrace on the Place du Forum, Arles, at Night, The'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKGA3
#025 Pierre-Auguste Renoir - 'The Great Bathers (The Nymphs)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKE5T
#026 Raphael (Raffaello Sanzio Da Urbino) - 'The School of Athens (detail 1) (Stanza della Segnatura)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDT7F
#027 Henri Matisse - 'Harmony in Red'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCMV
#028 Rene Magritte - 'The Menaced Assassin'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYU6F
#029 Joan Miro - 'Ciphers and Constellations, in Love with a Woman'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCTQ
#030 Edvard Munch - 'Melancholy'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XXU3N
#031 Claude Monet - 'Gare Saint Lazare, Pari'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKBVE
#032 Andrea Mantegna - 'The Lamentation over the Dead Christ'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8DNVVC
#033 Max Beckmann - 'The Night'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8LSVXF
#034 Caravaggio (Michelangelo Merisi) - 'Narcissus'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDJ3Z
#035 Diego Velazquez - 'Las Meninas (detail)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8Y2UZL
#036 Arshile Gorky - 'Waterfall'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XXP5J
#037 Gustav Klimt - 'Portrait of Adele Bloch-Bauer I'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=7Z5Q64
#038 Jackson Pollock - 'Number 1, 1949'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8EWJX6
#039 Pablo Picasso - 'Women of Algiers (Version O)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYP49
#040 Paul Cezanne - 'The Card Players'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYQ2G
#041 Paul Gauguin - 'Nafeaffaa Ipolpo (also known as When Will You Marry?)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDJ24
#042 Rose Maynard Barton - 'The Dream'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=9FJJTZ
#043 Vincent Van Gogh - 'Portrait of Dr. Gachet'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG3Q
#044 Vincent Van Gogh - 'The Sower'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDVLN
#045 Joan Miro - 'Joan Mir..- Catalan Landscape (The Hunter)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCVC
#046 Giuseppe Arcimboldo - 'Vortumnus (Vertumno)'
http://en.most-famous-paintings.com/MostFamousPainti

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\Paintings1000-Sup1-Sup1Blog-Home.html
// Date: unknown-date
// Language: HolyC

#001 Leonardo Da Vinci - 'Mona Lisa (La Gioconda)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYFFG
#002 Vincent Van Gogh - 'Starry-Night'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG47
#003 Edvard Munch - 'The Scream'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XXU4K
#004 Pablo Picasso - 'Three Musicians'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKDK5
#005 Jan Vermeer - 'The Girl with a Pearl Earring'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYC2C
#006 Rembrandt Van Rijn - 'Night Watch'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDJKC
#007 Gustav Klimt - 'The Kiss (Bacio)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCLN
#008 Claude Monet - 'Water Lilies'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8EWENT
#009 Georges Pierre Seurat - 'A Sunday Afternoon on the Island of La Grande Jatte'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YE42F
#010 Grant Wood - 'American Gothic'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XY5W5
#011 James Abbott Mcneill Whistler - 'Arrangement in Grey and Black. Portrait of the Painter's Mother'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8EWK3Z
#012 Vincent Van Gogh - 'Caf.. Terrace at Night'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG53
#013 Rene Magritte - 'The Son of Man'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYU67
#014 Pierre-Auguste Renoir - 'Dance at Moulin de la Galette'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYRLQ
#015 Edouard Manet - 'Olympia, Musee d'Orsay, Paris'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=9H5RBK
#016 Rene Magritte - 'Time transfixed'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKEMD
#017 Pablo Picasso - 'Les Demoiselles d'Avignon'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKH5G
#018 Caspar David Friedrich - 'The Sea of Ice'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=7YXQM8
#019 Francisco De Goya - 'Saturn Devouring His Son'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XY39P
#020 Michelangelo Buonarroti - 'Creation of Adam'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XZMGJ
#021 Vincent Van Gogh - 'Vincent's Bedroom in Arles'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKGVY
#022 Francisco De Goya - 'The Third of May 1808 (Execution of the Defenders of Madrid)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XY37T
#023 Vincent Van Gogh - 'The Night Cafe [1888]'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG2F
#024 Vincent Van Gogh - 'Cafe Terrace on the Place du Forum, Arles, at Night, The'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKGA3
#025 Pierre-Auguste Renoir - 'The Great Bathers (The Nymphs)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKE5T
#026 Raphael (Raffaello Sanzio Da Urbino) - 'The School of Athens (detail 1) (Stanza della Segnatura)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDT7F
#027 Henri Matisse - 'Harmony in Red'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCMV
#028 Rene Magritte - 'The Menaced Assassin'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYU6F
#029 Joan Miro - 'Ciphers and Constellations, in Love with a Woman'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCTQ
#030 Edvard Munch - 'Melancholy'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XXU3N
#031 Claude Monet - 'Gare Saint Lazare, Pari'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKBVE
#032 Andrea Mantegna - 'The Lamentation over the Dead Christ'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8DNVVC
#033 Max Beckmann - 'The Night'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8LSVXF
#034 Caravaggio (Michelangelo Merisi) - 'Narcissus'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDJ3Z
#035 Diego Velazquez - 'Las Meninas (detail)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8Y2UZL
#036 Arshile Gorky - 'Waterfall'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XXP5J
#037 Gustav Klimt - 'Portrait of Adele Bloch-Bauer I'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=7Z5Q64
#038 Jackson Pollock - 'Number 1, 1949'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8EWJX6
#039 Pablo Picasso - 'Women of Algiers (Version O)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYP49
#040 Paul Cezanne - 'The Card Players'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8XYQ2G
#041 Paul Gauguin - 'Nafeaffaa Ipolpo (also known as When Will You Marry?)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDJ24
#042 Rose Maynard Barton - 'The Dream'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=9FJJTZ
#043 Vincent Van Gogh - 'Portrait of Dr. Gachet'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKG3Q
#044 Vincent Van Gogh - 'The Sower'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=8YDVLN
#045 Joan Miro - 'Joan Mir..- Catalan Landscape (The Hunter)'
http://en.most-famous-paintings.com/MostFamousPaintings.nsf/A?Open&A=5ZKCVC
#046 Giuseppe Arcimboldo - 'Vortumnus (Vertumno)'
http://en.most-famous-paintings.com/MostFamousPainti


// Source: D:\TempleOS-Projects\html\Circuit-Sup1-Sup1CodeScraps-Home.html
// Date: unknown-date
// Language: HolyC

<1>/* Graphics Not Rendered in HTML */

<2>/* Graphics Not Rendered in HTML */

<3>/* Graphics Not Rendered in HTML */

<4>/* Graphics Not Rendered in HTML */

<5>/* Graphics Not Rendered in HTML */

<6>/* Graphics Not Rendered in HTML */

#define A_EAST  0
#define A_NORTH 1
#define A_WEST  2
#define A_SOUTH 3

U0 OrthRot(I64 *_x,I64 *_y,I64 theta)
{
  switch [theta&3] {
    case A_EAST:
      break;
    case A_NORTH:
      *_y=-*_y;
      SwapI64(_x,_y);
      break;
    case A_WEST:
      *_x=-*_x;
      *_y=-*_y;
      break;
    case A_SOUTH:
      *_x=-*_x;
      SwapI64(_x,_y);
      break;
  }
}

#define TERMINALS_NUM   6

#define ET_R            0
#define ET_L            1
#define ET_C            2
#define ET_TYPES_NUM    3

class ElementType
{
  U8 *black_img,*red_img;
  I64 terminals;
  CD2I64 term[TERMINALS_NUM];
  I64 min_x,max_x,min_y,max_y;
};

ElementType et[ET_TYPES_NUM] =
{
    {<1>,<2>,2,{{-12,1},{13,1},{0,0},{0,0},{0,0},{0,0}},0,0,0,0},
          {<3>,<4>,2,{{-14,0},{15,0},{0,0},{0,0},{0,0},{0,0}},0,0,0,0},
          {<5>,<6>,2,{{-4 ,0},{6 ,0},{0,0},{0,0},{0,0},{0,0}},0,0,0,0},
};

extern class Element;
class Terminal
{
  Element *e;
  I64 terminal;
};

#define Df_PROCESSED            0
#define Df_JUNCTION             1
#define Df_TERMINAL             2
#define Df_TERMINAL_LEFT        3
#define Df_TERMINAL_RIGHT       4
#define Df_TERMINAL_TOP         5
#define Df_TERMINAL_BOTTOM      6

class Dot  //These are points on a node
{
  Dot *next,*last;
  I64 x,y,saved_x,saved_y;
  Element *e;
  U16  flags[4];
  Dot *left,*right,*top,*bottom;
};

class Node
{
  Node *next,*last;
  I64 cnt;
  Terminal *terms;
  Dot *dot_head;
} node_head;

class Element
{
  Element *next,*last;
  ElementType *type;
  I64 x,y,theta,min_x,max_x,min_y,max_y;
  Node *nodes[TERMINALS_NUM];
} el_head;

#define MD_CONNECT      0
#define MD_MOVE         1
#define MD_MODES_NUM    2
I64 mode;

Element *rubber_band;
I64 rubber_band_terminal,rubber_band_x,rubber_band_y;

U0 DotDel(Dot *head)
{
  if (head) {
    QueDel(head,TRUE);
    Free(head);
  }
}

U0 DotRst(Dot *head)
{
  Dot *tmpd;
  if (head) {
    Bts(head->flags,Df_PROCESSED);
    tmpd=head->next;
    while (tmpd!=head) {
      Btr(tmpd->flags,Df_PROCESSED);
      tmpd=tmpd->next;
    }
  }
}

#define DIR_LT  0
#define DIR_CT  1
#define DIR_RT  2
#define DIR_LC  3
#define DIR_CC  4
#define DIR_RC  5
#define DIR_LB  6
#define DIR_CB  7
#define DIR_RB  8

I64 ElementDistSqr(Element *tmpe,I64 x,I64 y)
{
  I64 i,dx,dy;
  if (x<tmpe->min_x)
    i=0;
  else if (x<=tmpe->max_x)
    i=1;
  else
    i=2;
  if (y>=tmpe->min_y) {
    if (y<=tmpe->max_y)
      i+=3;
    else
      i+=6;
  }
  switch (i) {
    case DIR_LT:
      dx=tmpe->min_x-x;
      dy=tmpe->min_y-y;
      break;
    case DIR_CT:
      dx=0;
      dy=tmpe->min_y-y;
      break;
    case DIR_RT:
      dx=x-tmpe->max_x;
      dy=tmpe->min_y-y;
      break;
    case DIR_LC:
      dx=tmpe->min_x-x;
      dy=0;
      break;
    case DIR_CC:
      dx=0;
      dy=0;
      break;
    case DIR_RC:
      dx=x-tmpe->max_x;
      dy=0;
      break;
    case DIR_LB:
      dx=tmpe->min_x-x;
      dy=y-tmpe->max_y;
      break;
    case DIR_CB:
      dx=0;
      dy=y-tmpe->max_y;
      break;
    case DIR_RB:
      dx=x-tmpe->max_x;
      dy=y-tmpe->max_y;
      break;
  }
  return SqrI64(dx)+SqrI64(dy);
}

#define SPACING 10

F64 DotNetScore(Dot *head)
{ //higher is better
  F64 d,distdist1=0.1,distdist2=0.1,num=1.0,den=0.1;
  I64 dx,dy,nonzero_cnt=1;
  Element *tmpe;
  Dot *tmpd,*tmpd1;
  if (head) {
    tmpd=head->next;
    while (tmpd!=head) {

      //Calculate clearance from elements like parallel resistors
      tmpe=el_head.next;
      while (tmpe!=&el_head) {
        if (tmpd->e!=tmpe) {
          d=Sqrt(ElementDistSqr(tmpe,tmpd->x,tmpd->y))+0.1;
          if (d>SPACING) d=SPACING;
          num*=d;
          den+=d;
        }
        tmpe=tmpe->next;
      }

      //Calculate clearance from junctions like parallel resistors
      if (Bt(tmpd->flags,Df_TERMINAL)) {
        tmpd1=head->next;
        while (tmpd1!=head) {
          if (tmpd1!=tmpd && Bt(tmpd1->flags,Df_JUNCTION)) {
            d=Sqrt(SqrI64(tmpd->x-tmpd1->x)+SqrI64(tmpd->y-tmpd1->y))+0.1;
            if (d>SPACING) d=SPACING;
            num*=d;
            den+=d;
          }
          tmpd1=tmpd1->next;
        }
      }

      if (tmpd1=tmpd->left) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dy;
      }
      if (tmpd1=tmpd->right) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dy;
      }
      if (tmpd1=tmpd->top) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dx;
      }
      if (tmpd1=tmpd->bottom) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dx;
      }
      tmpd=tmpd->next;
    }
  }
  return num/(nonzero_cnt*nonzero_cnt*nonzero_cnt*distdist1*distdist2);
}

Bool NodeAdd(Node *tmpn,Element *tmpe,I64 terminal,CTask *mem_task=NULL)
{
  I64 i;
  Terminal *a;
  for (i=0;i<tmpn->cnt;i++)
    if (tmpn->terms[i].e==tmpe&&tmpn->terms[i].terminal==terminal)
      return TRUE;
  a=MAlloc((tmpn->cnt+1)*sizeof(Terminal),mem_task);
  if (tmpn->terms) {
    MemCpy(a,tmpn->terms,tmpn->cnt*sizeof(Terminal));
    Free(tmpn->terms);
  }
  tmpn->terms=a;
  i=tmpn->cnt++;
  tmpn->terms[i].e=tmpe;
  tmpn->terms[i].terminal=terminal;
  return FALSE;
}

U0 NodeDel(Node *tmpn)
{
  if (tmpn) {
    QueRem(tmpn);
    Free(tmpn->terms);
    if (tmpn->dot_head)
      DotDel(tmpn->dot_head);
    Free(tmpn);
  }
}

extern Dot *DotNew(Node *tmpn,CTask *mem_task=

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\Circuit-Sup1-Sup1CodeScraps-Home.html
// Date: unknown-date
// Language: HolyC

<1>/* Graphics Not Rendered in HTML */

<2>/* Graphics Not Rendered in HTML */

<3>/* Graphics Not Rendered in HTML */

<4>/* Graphics Not Rendered in HTML */

<5>/* Graphics Not Rendered in HTML */

<6>/* Graphics Not Rendered in HTML */

#define A_EAST  0
#define A_NORTH 1
#define A_WEST  2
#define A_SOUTH 3

U0 OrthRot(I64 *_x,I64 *_y,I64 theta)
{
  switch [theta&3] {
    case A_EAST:
      break;
    case A_NORTH:
      *_y=-*_y;
      SwapI64(_x,_y);
      break;
    case A_WEST:
      *_x=-*_x;
      *_y=-*_y;
      break;
    case A_SOUTH:
      *_x=-*_x;
      SwapI64(_x,_y);
      break;
  }
}

#define TERMINALS_NUM   6

#define ET_R            0
#define ET_L            1
#define ET_C            2
#define ET_TYPES_NUM    3

class ElementType
{
  U8 *black_img,*red_img;
  I64 terminals;
  CD2I64 term[TERMINALS_NUM];
  I64 min_x,max_x,min_y,max_y;
};

ElementType et[ET_TYPES_NUM] =
{
    {<1>,<2>,2,{{-12,1},{13,1},{0,0},{0,0},{0,0},{0,0}},0,0,0,0},
          {<3>,<4>,2,{{-14,0},{15,0},{0,0},{0,0},{0,0},{0,0}},0,0,0,0},
          {<5>,<6>,2,{{-4 ,0},{6 ,0},{0,0},{0,0},{0,0},{0,0}},0,0,0,0},
};

extern class Element;
class Terminal
{
  Element *e;
  I64 terminal;
};

#define Df_PROCESSED            0
#define Df_JUNCTION             1
#define Df_TERMINAL             2
#define Df_TERMINAL_LEFT        3
#define Df_TERMINAL_RIGHT       4
#define Df_TERMINAL_TOP         5
#define Df_TERMINAL_BOTTOM      6

class Dot  //These are points on a node
{
  Dot *next,*last;
  I64 x,y,saved_x,saved_y;
  Element *e;
  U16  flags[4];
  Dot *left,*right,*top,*bottom;
};

class Node
{
  Node *next,*last;
  I64 cnt;
  Terminal *terms;
  Dot *dot_head;
} node_head;

class Element
{
  Element *next,*last;
  ElementType *type;
  I64 x,y,theta,min_x,max_x,min_y,max_y;
  Node *nodes[TERMINALS_NUM];
} el_head;

#define MD_CONNECT      0
#define MD_MOVE         1
#define MD_MODES_NUM    2
I64 mode;

Element *rubber_band;
I64 rubber_band_terminal,rubber_band_x,rubber_band_y;

U0 DotDel(Dot *head)
{
  if (head) {
    QueDel(head,TRUE);
    Free(head);
  }
}

U0 DotRst(Dot *head)
{
  Dot *tmpd;
  if (head) {
    Bts(head->flags,Df_PROCESSED);
    tmpd=head->next;
    while (tmpd!=head) {
      Btr(tmpd->flags,Df_PROCESSED);
      tmpd=tmpd->next;
    }
  }
}

#define DIR_LT  0
#define DIR_CT  1
#define DIR_RT  2
#define DIR_LC  3
#define DIR_CC  4
#define DIR_RC  5
#define DIR_LB  6
#define DIR_CB  7
#define DIR_RB  8

I64 ElementDistSqr(Element *tmpe,I64 x,I64 y)
{
  I64 i,dx,dy;
  if (x<tmpe->min_x)
    i=0;
  else if (x<=tmpe->max_x)
    i=1;
  else
    i=2;
  if (y>=tmpe->min_y) {
    if (y<=tmpe->max_y)
      i+=3;
    else
      i+=6;
  }
  switch (i) {
    case DIR_LT:
      dx=tmpe->min_x-x;
      dy=tmpe->min_y-y;
      break;
    case DIR_CT:
      dx=0;
      dy=tmpe->min_y-y;
      break;
    case DIR_RT:
      dx=x-tmpe->max_x;
      dy=tmpe->min_y-y;
      break;
    case DIR_LC:
      dx=tmpe->min_x-x;
      dy=0;
      break;
    case DIR_CC:
      dx=0;
      dy=0;
      break;
    case DIR_RC:
      dx=x-tmpe->max_x;
      dy=0;
      break;
    case DIR_LB:
      dx=tmpe->min_x-x;
      dy=y-tmpe->max_y;
      break;
    case DIR_CB:
      dx=0;
      dy=y-tmpe->max_y;
      break;
    case DIR_RB:
      dx=x-tmpe->max_x;
      dy=y-tmpe->max_y;
      break;
  }
  return SqrI64(dx)+SqrI64(dy);
}

#define SPACING 10

F64 DotNetScore(Dot *head)
{ //higher is better
  F64 d,distdist1=0.1,distdist2=0.1,num=1.0,den=0.1;
  I64 dx,dy,nonzero_cnt=1;
  Element *tmpe;
  Dot *tmpd,*tmpd1;
  if (head) {
    tmpd=head->next;
    while (tmpd!=head) {

      //Calculate clearance from elements like parallel resistors
      tmpe=el_head.next;
      while (tmpe!=&el_head) {
        if (tmpd->e!=tmpe) {
          d=Sqrt(ElementDistSqr(tmpe,tmpd->x,tmpd->y))+0.1;
          if (d>SPACING) d=SPACING;
          num*=d;
          den+=d;
        }
        tmpe=tmpe->next;
      }

      //Calculate clearance from junctions like parallel resistors
      if (Bt(tmpd->flags,Df_TERMINAL)) {
        tmpd1=head->next;
        while (tmpd1!=head) {
          if (tmpd1!=tmpd && Bt(tmpd1->flags,Df_JUNCTION)) {
            d=Sqrt(SqrI64(tmpd->x-tmpd1->x)+SqrI64(tmpd->y-tmpd1->y))+0.1;
            if (d>SPACING) d=SPACING;
            num*=d;
            den+=d;
          }
          tmpd1=tmpd1->next;
        }
      }

      if (tmpd1=tmpd->left) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dy;
      }
      if (tmpd1=tmpd->right) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dy;
      }
      if (tmpd1=tmpd->top) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dx;
      }
      if (tmpd1=tmpd->bottom) {
        dx=SqrI64(tmpd->x-tmpd1->x);
        dy=SqrI64(tmpd->y-tmpd1->y);
        if (d=dx+dy) {
          distdist1+=d;
          nonzero_cnt++;
        }
        distdist2+=dx;
      }
      tmpd=tmpd->next;
    }
  }
  return num/(nonzero_cnt*nonzero_cnt*nonzero_cnt*distdist1*distdist2);
}

Bool NodeAdd(Node *tmpn,Element *tmpe,I64 terminal,CTask *mem_task=NULL)
{
  I64 i;
  Terminal *a;
  for (i=0;i<tmpn->cnt;i++)
    if (tmpn->terms[i].e==tmpe&&tmpn->terms[i].terminal==terminal)
      return TRUE;
  a=MAlloc((tmpn->cnt+1)*sizeof(Terminal),mem_task);
  if (tmpn->terms) {
    MemCpy(a,tmpn->terms,tmpn->cnt*sizeof(Terminal));
    Free(tmpn->terms);
  }
  tmpn->terms=a;
  i=tmpn->cnt++;
  tmpn->terms[i].e=tmpe;
  tmpn->terms[i].terminal=terminal;
  return FALSE;
}

U0 NodeDel(Node *tmpn)
{
  if (tmpn) {
    QueRem(tmpn);
    Free(tmpn->terms);
    if (tmpn->dot_head)
      DotDel(tmpn->dot_head);
    Free(tmpn);
  }
}

extern Dot *DotNew(Node *tmpn,CTask *mem_task=


// Source: D:\TempleOS-Projects\html\GodTalking-Sup1-Sup1Games-AfterEgypt-Home.html
// Date: unknown-date
// Language: HolyC

<1>/* Graphics Not Rendered in HTML */

        <2>/* Graphics Not Rendered in HTML */

        <3>/* Graphics Not Rendered in HTML */

<4>/* Graphics Not Rendered in HTML */ //Pointer to sprite in Mountain.HC file

U0 DrawGodTalking(CTask *,CDC *dc)
{
  I64 i;
  F64 m,a,x1,y1,x2,y2,t;
  Sprite3(dc,0,20*FONT_HEIGHT,0,<4>);
  if (Blink(0.4))
    Sprite3(dc,44,99,0,<1>);
  else
    Sprite3(dc,44,99,0,<2>);
  Sprite3(dc,213,91,0,<3>);
  dc->color=winmgr.updates&15;
  for (i=0;i<256;i++) {
    m=Sqr(Rand); a=2*pi*Rand;
    P2R(&x1,&y1,m,a);
    m=Sqr(Rand); a=2*pi*Rand;
    P2R(&x2,&y2,m,a);
    GrLine(dc,235+30*x1,56+30*y1,235+30*x2,40+30*y2);
  }
  if (tS%4.0<2.0)
    t=FullTri(tS,2.0);
  else
    t=0;
  dc->thick=3;
  dc->color=BROWN;
  for (i=0+10*Abs(t);i<120-10*Abs(t);i++)
    GrPlot3(dc,i+10,110+4*t*Sin(i/6.0),0);
}

U0 UpTheMountain()
{
  I64 i;
  Mountain;
  Horeb;

  SettingsPush(Fs,TSF_SAME_SONG); //See SettingsPush
  Fs->text_attr=YELLOW<<4+BLUE;
  Fs->draw_it=&DrawGodTalking;
  "$BG,LTCYAN$%h10c",'\n';
  "$BG,YELLOW$$WW,1$$CM,0,22$God Says...$RED$\n";
  if (!FileFind(BIBLE_FILENAME) || GodBits(1))
    for (i=0;i<16;i++) {
      FifoU8Flush(god.fifo);
      GodWord;
    }
  else {
    FifoU8Flush(god.fifo);
    GodBiblePassage;
  }
  "$FG$\n\nPress <SHIFT-ESC>.\n";
  View;
  DocClear;
  SettingsPop(Fs,TSF_SAME_SONG);
}

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\GodTalking-Sup1-Sup1Games-AfterEgypt-Home.html
// Date: unknown-date
// Language: HolyC

<1>/* Graphics Not Rendered in HTML */

        <2>/* Graphics Not Rendered in HTML */

        <3>/* Graphics Not Rendered in HTML */

<4>/* Graphics Not Rendered in HTML */ //Pointer to sprite in Mountain.HC file

U0 DrawGodTalking(CTask *,CDC *dc)
{
  I64 i;
  F64 m,a,x1,y1,x2,y2,t;
  Sprite3(dc,0,20*FONT_HEIGHT,0,<4>);
  if (Blink(0.4))
    Sprite3(dc,44,99,0,<1>);
  else
    Sprite3(dc,44,99,0,<2>);
  Sprite3(dc,213,91,0,<3>);
  dc->color=winmgr.updates&15;
  for (i=0;i<256;i++) {
    m=Sqr(Rand); a=2*pi*Rand;
    P2R(&x1,&y1,m,a);
    m=Sqr(Rand); a=2*pi*Rand;
    P2R(&x2,&y2,m,a);
    GrLine(dc,235+30*x1,56+30*y1,235+30*x2,40+30*y2);
  }
  if (tS%4.0<2.0)
    t=FullTri(tS,2.0);
  else
    t=0;
  dc->thick=3;
  dc->color=BROWN;
  for (i=0+10*Abs(t);i<120-10*Abs(t);i++)
    GrPlot3(dc,i+10,110+4*t*Sin(i/6.0),0);
}

U0 UpTheMountain()
{
  I64 i;
  Mountain;
  Horeb;

  SettingsPush(Fs,TSF_SAME_SONG); //See SettingsPush
  Fs->text_attr=YELLOW<<4+BLUE;
  Fs->draw_it=&DrawGodTalking;
  "$BG,LTCYAN$%h10c",'\n';
  "$BG,YELLOW$$WW,1$$CM,0,22$God Says...$RED$\n";
  if (!FileFind(BIBLE_FILENAME) || GodBits(1))
    for (i=0;i<16;i++) {
      FifoU8Flush(god.fifo);
      GodWord;
    }
  else {
    FifoU8Flush(god.fifo);
    GodBiblePassage;
  }
  "$FG$\n\nPress <SHIFT-ESC>.\n";
  View;
  DocClear;
  SettingsPop(Fs,TSF_SAME_SONG);
}


// Source: D:\TempleOS-Projects\html\DiningStars-Sup1-Sup1Games-Home.html
// Date: unknown-date
// Language: HolyC

//This uses fixed-point.

RegDft("TempleOS/DiningStars","F64 best_score=9999;\n");
RegExe("TempleOS/DiningStars");

#define PERSON_SCALE    6.0

                <1>/* Graphics Not Rendered in HTML */

                <2>/* Graphics Not Rendered in HTML */

                <3>/* Graphics Not Rendered in HTML */

#define PLANT_SCALE     6.0

                     <4>/* Graphics Not Rendered in HTML */

                      <5>/* Graphics Not Rendered in HTML */

class Wall
{
  Wall *next,*last;
  CD3I32 p1,p2;
  I64 cpu_num;
} walls_head;

#define SCRN_SCALE              1024
#define PLOT_GRID_WIDTH         24
#define PLOT_GRID_HEIGHT        24
#define MAN_HEIGHT              300
#define WALL_HEIGHT             1.0
#define BLUEPRINT_SCALE         4

CDC *blueprint_dc;
I64 blueprint_width,blueprint_height;
U8 *blueprint=NULL,
   *panels_processed=NULL;

I64 man_xx,man_yy;
F64 man_theta;

F64 t0,tf;

#define PERSONS_NUM     16
class Person
{
  I64 x,y;
} persons[PERSONS_NUM];

U0 DSTransform(CDC *dc,I64 *x,I64 *y,I64 *z)
{
  I64 zz;
  Mat4x4MulXYZ(dc->r,x,y,z);
  zz=SCRN_SCALE/3+*z;
  if (zz<1) zz=1;
  *x=SCRN_SCALE/2* *x/zz;
  *y=SCRN_SCALE/2* (*y+MAN_HEIGHT)/zz;
  *x+=dc->x;
  *y+=dc->y;
  *z+=dc->z;
}

public U0 DSLighting(CDC *dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p3,
        CColorROPU32 color)
{
  CD3I32 v1,v2;
  I64 i,vn_x,vn_y,vn_z;
  F64 d;

  v1.x=p1->x-p2->x;
  v1.y=p1->y-p2->y;
  v1.z=p1->z-p2->z;

  v2.x=p3->x-p2->x;
  v2.y=p3->y-p2->y;
  v2.z=p3->z-p2->z;

  //V1 and V2 are vects along two sides
  //of the tri joined at p2.

  vn_x=v1.y*v2.z-v1.z*v2.y;
  vn_y=v1.z*v2.x-v1.x*v2.z;
  vn_z=v1.x*v2.y-v1.y*v2.x;
  if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z)))
    d=1<<16/d;
  vn_x*=d;
  vn_y*=d;
  vn_z*=d;
//Vn is the cross product of V1 and V3
  //which means it is perpendicular.  It
  //is the normal vect to the surface.
  //It has been scaled to length 65536.

  //Light source has been scaled to length 65536.
  i=(vn_x*dc->ls.x+vn_y*dc->ls.y+vn_z*dc->ls.z)>>16;

  i=(0x8000+i)>>1;//Tables are too dark ****TODO****

  //The dot product of the light source
  //vect and the surface normal
  //gives an illumination number.
  //65536*65536>>16=65536

  //TempleOS will generate a random U16
  //and compare to dither_probability_u16 and
  //will pick from two colors.
  //Probability dithering does not work with thick>1 at this time.
  if (color.c0.rop&ROPBF_TWO_SIDED) {
    color.c0.rop&=~ROPBF_TWO_SIDED;
    i=AbsI64(i)<<1;
  } else
    i+=65536;
  if (color.c0.rop&ROPBF_HALF_RANGE_COLOR) {
    color.c0.rop&=~ROPBF_HALF_RANGE_COLOR;
    i>>=1;
    if (color>=8) {
      color-=8;
      i+=65536;
    }
  }
  if (i<65536) {
    dc->color=ROPF_PROBABILITY_DITHER+color<<16+BLACK;
    dc->dither_probability_u16=i;
  } else {
    dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color;
    dc->dither_probability_u16=i-65536;
  }
}

#define LOS_SCALE       4

Bool LOSPlot(U8 *,I64 x,I64 y,I64)
{
  if (blueprint[(y/LOS_SCALE)*blueprint_width+(x/LOS_SCALE)]==WHITE)
    return FALSE;
  else
    return TRUE;
}

Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2)
{ //Line of sight
  return Line(NULL,x1*LOS_SCALE/SCRN_SCALE,y1*LOS_SCALE/SCRN_SCALE,0,
        x2*LOS_SCALE/SCRN_SCALE,y2*LOS_SCALE/SCRN_SCALE,0,&LOSPlot);
}

I64 mp_not_done_flags;
I64 *r1,*r2,*r3,*s2w,cx,cy,xh,yh,zh,x1h,y1h;

U0 MPDrawWalls(CDC *_dc)
{
  CD3I32 poly[4];
  I64 i,j,n,cpu_num=Gs->num,xx,yy,x,y,x1,y1,z1,x2,y2,_x1h,_y1h,
        dx,dy,xx1,yy1,xx2,yy2,c,x1w,y1w,*_r3=Mat4x4New(r3);
  Wall *tmpw;
  CDC *dc=MAllocIdent(_dc);
  dc->r=Mat4x4New(_dc->r);
  _x1h=x1h-xh*cpu_num;
  _y1h=y1h-yh*cpu_num;
  for (j=cpu_num;j<PLOT_GRID_HEIGHT*2;j+=mp_cnt) {
    x1w=_x1h;
    y1w=_y1h;
    for (i=0;i<PLOT_GRID_WIDTH*4;i++) {
      xx=x1w/SCRN_SCALE; yy=y1w/SCRN_SCALE;
      x=xx*SCRN_SCALE-man_xx; y=yy*SCRN_SCALE-man_yy;
      if (1<=xx<blueprint_width-1 && 1<=yy<blueprint_height-1 &&
            !LBts(panels_processed,yy*blueprint_width+xx)) {
        if ((c=blueprint[yy*blueprint_width+xx]) &&
              LOS(xx*SCRN_SCALE+SCRN_SCALE/2,
              yy*SCRN_SCALE+SCRN_SCALE/2,
              man_xx,man_yy)) {
          if (c==WHITE||c==LTBLUE)
            dc->color=BROWN;
          else
            dc->color=c;
          poly[0].x=x;
          poly[0].y=y;
          poly[0].z=0;
          poly[1].x=x+SCRN_SCALE;
          poly[1].y=y;
          poly[1].z=0;
          poly[2].x=x+SCRN_SCALE;
          poly[2].y=y+SCRN_SCALE;
          poly[2].z=0;
          poly[3].x=x;
          poly[3].y=y+SCRN_SCALE;
          poly[3].z=0;
          GrFillPoly3(dc,4,poly);
          if (!((yy*blueprint_width+xx)%3)) {
            if (c==GREEN) {
              x1=x+SCRN_SCALE/2;
              y1=y+SCRN_SCALE/2;
              z1=0;
              DCTransform(dc,&x1,&y1,&z1);
              if (z1>0)
                Sprite3Mat4x4B(dc,x+SCRN_SCALE/2,y+SCRN_SCALE/2,0,<4>,_r3);
            } else if (c==BROWN) {
              x1=x+SCRN_SCALE/2;
              y1=y+SCRN_SCALE/2;
              z1=0;
              DCTransform(dc,&x1,&y1,&z1);
              if (z1>0)
                Sprite3Mat4x4B(dc,x+SCRN_SCALE/2,y+SCRN_SCALE/2,0,<5>,_r3);
            }
          }
        }
      }
      x1w-=yh;
      y1w+=xh;
    }
    _x1h-=xh*mp_cnt;
    _y1h-=yh*mp_cnt;
  }

  tmpw=walls_head.next;
  while (tmpw!=&walls_head) {
    if (tmpw->cpu_num==cpu_num) {
      dc->color=YELLOW;
      x1=tmpw->p1.x*SCRN_SCALE/BLUEPRINT_SCALE-man_xx;
      y1=tmpw->p1.y*SCRN_SCALE/BLUEPRINT_SCALE-man_yy;
      x2=tmpw->p2.x*SCRN_SCALE/BLUEPRINT_SCALE-man_xx;
      y2=tmpw->p2.y*SCRN_SCALE/BLUEPRINT_SCALE-man_yy;

      //The foreshortening distorts Z coordinates in a funny way,
      //so we do the wall in tiny pieces.
      n=2*(AbsI64(x2-x1)+AbsI64(y2-y1))/SCRN_SCALE;
      if (n<1) n=1;
      dx=(x2-x1)<<16/n;
      dy=(y2-y1)<<16/n;
      xx1=x1<<16;
      yy1=y1<<16;
      for (i=0;i<n;i++) {
        xx2=xx1+dx;
        yy2=yy1+dy;
        poly[0].x=xx1>>16;
        po

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\DiningStars-Sup1-Sup1Games-Home.html
// Date: unknown-date
// Language: HolyC

//This uses fixed-point.

RegDft("TempleOS/DiningStars","F64 best_score=9999;\n");
RegExe("TempleOS/DiningStars");

#define PERSON_SCALE    6.0

                <1>/* Graphics Not Rendered in HTML */

                <2>/* Graphics Not Rendered in HTML */

                <3>/* Graphics Not Rendered in HTML */

#define PLANT_SCALE     6.0

                     <4>/* Graphics Not Rendered in HTML */

                      <5>/* Graphics Not Rendered in HTML */

class Wall
{
  Wall *next,*last;
  CD3I32 p1,p2;
  I64 cpu_num;
} walls_head;

#define SCRN_SCALE              1024
#define PLOT_GRID_WIDTH         24
#define PLOT_GRID_HEIGHT        24
#define MAN_HEIGHT              300
#define WALL_HEIGHT             1.0
#define BLUEPRINT_SCALE         4

CDC *blueprint_dc;
I64 blueprint_width,blueprint_height;
U8 *blueprint=NULL,
   *panels_processed=NULL;

I64 man_xx,man_yy;
F64 man_theta;

F64 t0,tf;

#define PERSONS_NUM     16
class Person
{
  I64 x,y;
} persons[PERSONS_NUM];

U0 DSTransform(CDC *dc,I64 *x,I64 *y,I64 *z)
{
  I64 zz;
  Mat4x4MulXYZ(dc->r,x,y,z);
  zz=SCRN_SCALE/3+*z;
  if (zz<1) zz=1;
  *x=SCRN_SCALE/2* *x/zz;
  *y=SCRN_SCALE/2* (*y+MAN_HEIGHT)/zz;
  *x+=dc->x;
  *y+=dc->y;
  *z+=dc->z;
}

public U0 DSLighting(CDC *dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p3,
        CColorROPU32 color)
{
  CD3I32 v1,v2;
  I64 i,vn_x,vn_y,vn_z;
  F64 d;

  v1.x=p1->x-p2->x;
  v1.y=p1->y-p2->y;
  v1.z=p1->z-p2->z;

  v2.x=p3->x-p2->x;
  v2.y=p3->y-p2->y;
  v2.z=p3->z-p2->z;

  //V1 and V2 are vects along two sides
  //of the tri joined at p2.

  vn_x=v1.y*v2.z-v1.z*v2.y;
  vn_y=v1.z*v2.x-v1.x*v2.z;
  vn_z=v1.x*v2.y-v1.y*v2.x;
  if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z)))
    d=1<<16/d;
  vn_x*=d;
  vn_y*=d;
  vn_z*=d;
//Vn is the cross product of V1 and V3
  //which means it is perpendicular.  It
  //is the normal vect to the surface.
  //It has been scaled to length 65536.

  //Light source has been scaled to length 65536.
  i=(vn_x*dc->ls.x+vn_y*dc->ls.y+vn_z*dc->ls.z)>>16;

  i=(0x8000+i)>>1;//Tables are too dark ****TODO****

  //The dot product of the light source
  //vect and the surface normal
  //gives an illumination number.
  //65536*65536>>16=65536

  //TempleOS will generate a random U16
  //and compare to dither_probability_u16 and
  //will pick from two colors.
  //Probability dithering does not work with thick>1 at this time.
  if (color.c0.rop&ROPBF_TWO_SIDED) {
    color.c0.rop&=~ROPBF_TWO_SIDED;
    i=AbsI64(i)<<1;
  } else
    i+=65536;
  if (color.c0.rop&ROPBF_HALF_RANGE_COLOR) {
    color.c0.rop&=~ROPBF_HALF_RANGE_COLOR;
    i>>=1;
    if (color>=8) {
      color-=8;
      i+=65536;
    }
  }
  if (i<65536) {
    dc->color=ROPF_PROBABILITY_DITHER+color<<16+BLACK;
    dc->dither_probability_u16=i;
  } else {
    dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color;
    dc->dither_probability_u16=i-65536;
  }
}

#define LOS_SCALE       4

Bool LOSPlot(U8 *,I64 x,I64 y,I64)
{
  if (blueprint[(y/LOS_SCALE)*blueprint_width+(x/LOS_SCALE)]==WHITE)
    return FALSE;
  else
    return TRUE;
}

Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2)
{ //Line of sight
  return Line(NULL,x1*LOS_SCALE/SCRN_SCALE,y1*LOS_SCALE/SCRN_SCALE,0,
        x2*LOS_SCALE/SCRN_SCALE,y2*LOS_SCALE/SCRN_SCALE,0,&LOSPlot);
}

I64 mp_not_done_flags;
I64 *r1,*r2,*r3,*s2w,cx,cy,xh,yh,zh,x1h,y1h;

U0 MPDrawWalls(CDC *_dc)
{
  CD3I32 poly[4];
  I64 i,j,n,cpu_num=Gs->num,xx,yy,x,y,x1,y1,z1,x2,y2,_x1h,_y1h,
        dx,dy,xx1,yy1,xx2,yy2,c,x1w,y1w,*_r3=Mat4x4New(r3);
  Wall *tmpw;
  CDC *dc=MAllocIdent(_dc);
  dc->r=Mat4x4New(_dc->r);
  _x1h=x1h-xh*cpu_num;
  _y1h=y1h-yh*cpu_num;
  for (j=cpu_num;j<PLOT_GRID_HEIGHT*2;j+=mp_cnt) {
    x1w=_x1h;
    y1w=_y1h;
    for (i=0;i<PLOT_GRID_WIDTH*4;i++) {
      xx=x1w/SCRN_SCALE; yy=y1w/SCRN_SCALE;
      x=xx*SCRN_SCALE-man_xx; y=yy*SCRN_SCALE-man_yy;
      if (1<=xx<blueprint_width-1 && 1<=yy<blueprint_height-1 &&
            !LBts(panels_processed,yy*blueprint_width+xx)) {
        if ((c=blueprint[yy*blueprint_width+xx]) &&
              LOS(xx*SCRN_SCALE+SCRN_SCALE/2,
              yy*SCRN_SCALE+SCRN_SCALE/2,
              man_xx,man_yy)) {
          if (c==WHITE||c==LTBLUE)
            dc->color=BROWN;
          else
            dc->color=c;
          poly[0].x=x;
          poly[0].y=y;
          poly[0].z=0;
          poly[1].x=x+SCRN_SCALE;
          poly[1].y=y;
          poly[1].z=0;
          poly[2].x=x+SCRN_SCALE;
          poly[2].y=y+SCRN_SCALE;
          poly[2].z=0;
          poly[3].x=x;
          poly[3].y=y+SCRN_SCALE;
          poly[3].z=0;
          GrFillPoly3(dc,4,poly);
          if (!((yy*blueprint_width+xx)%3)) {
            if (c==GREEN) {
              x1=x+SCRN_SCALE/2;
              y1=y+SCRN_SCALE/2;
              z1=0;
              DCTransform(dc,&x1,&y1,&z1);
              if (z1>0)
                Sprite3Mat4x4B(dc,x+SCRN_SCALE/2,y+SCRN_SCALE/2,0,<4>,_r3);
            } else if (c==BROWN) {
              x1=x+SCRN_SCALE/2;
              y1=y+SCRN_SCALE/2;
              z1=0;
              DCTransform(dc,&x1,&y1,&z1);
              if (z1>0)
                Sprite3Mat4x4B(dc,x+SCRN_SCALE/2,y+SCRN_SCALE/2,0,<5>,_r3);
            }
          }
        }
      }
      x1w-=yh;
      y1w+=xh;
    }
    _x1h-=xh*mp_cnt;
    _y1h-=yh*mp_cnt;
  }

  tmpw=walls_head.next;
  while (tmpw!=&walls_head) {
    if (tmpw->cpu_num==cpu_num) {
      dc->color=YELLOW;
      x1=tmpw->p1.x*SCRN_SCALE/BLUEPRINT_SCALE-man_xx;
      y1=tmpw->p1.y*SCRN_SCALE/BLUEPRINT_SCALE-man_yy;
      x2=tmpw->p2.x*SCRN_SCALE/BLUEPRINT_SCALE-man_xx;
      y2=tmpw->p2.y*SCRN_SCALE/BLUEPRINT_SCALE-man_yy;

      //The foreshortening distorts Z coordinates in a funny way,
      //so we do the wall in tiny pieces.
      n=2*(AbsI64(x2-x1)+AbsI64(y2-y1))/SCRN_SCALE;
      if (n<1) n=1;
      dx=(x2-x1)<<16/n;
      dy=(y2-y1)<<16/n;
      xx1=x1<<16;
      yy1=y1<<16;
      for (i=0;i<n;i++) {
        xx2=xx1+dx;
        yy2=yy1+dy;
        poly[0].x=xx1>>16;
        po


// Source: D:\TempleOS-Projects\html\DocLink-DolDoc-Adam.html
// Date: unknown-date
// Language: HolyC

#help_index "DolDoc/Link"

/* See TempleOS Link Types.
"filename"
"FI:filename"
"FA:haystack_filename,needle_anchor_str"
"FF:haystack_filename,needle_str"
"FF:haystack_filename,needle_str:occurnum"
"FL:filename,linenum"
"MN:SymName"
"PI:filename"
"PF:haystack_filename,needle_str"
"PF:haystack_filename,needle_str:occurnum"
"PL:filename,linenum"
"BF:haystack_bible_book,needle_str"
"DN:word"
"DN:word,defnum"
"HI:index"
"AD:code_address_number"

To edit a doc structure already in memory. See SpriteEdText().
"AI:doc_address"
"AA:haystack_doc_address,needle_anchor_str"
"AF:haystack_doc_address,needle_str"
"AF:haystack_doc_address,needle_str:occurnum"
"AL:doc_address,linenum"
*/

#define LK_FILE         0
#define LK_FILE_ANCHOR  1
#define LK_FILE_FIND    2
#define LK_FILE_LINE    3
#define LK_MAN_PAGE     4
#define LK_PLAIN        5
#define LK_PLAIN_FIND   6
#define LK_PLAIN_LINE   7
#define LK_BIBLE_FIND   8
#define LK_DEF          9
#define LK_HELP_INDEX   10
#define LK_ADDR         11
#define LK_DOC          12 //See SpriteEdText()
#define LK_DOC_ANCHOR   13
#define LK_DOC_FIND     14
#define LK_DOC_LINE     15
#define LK_PLACE_ANCHOR 16

public U8 *DocEntryLink(CDoc *doc,CDocEntry *doc_e)
{//MAlloc new str, either tag or aux_str if link.
  if (doc_e->de_flags&DOCEF_LINK) {
    if (doc_e->de_flags & DOCEF_AUX_STR)
      return StrNew(doc_e->aux_str,doc->mem_task);
    else if (doc_e->de_flags & DOCEF_TAG)
      return StrNew(doc_e->tag,doc->mem_task);
  }
  return NULL;
}

Bool DocFileEd(I64 _type,U8 *filename,
        U8 *needle_str,I64 *_num,I64 edf_dof_flags)
{
  I64 type=_type,flags=0,old_border_src=Fs->border_src;
  CDocEntry *doc_e;
  CDoc *doc;
  Bool old_silent=Bt(&Fs->display_flags,DISPLAYf_SILENT),
        res=FALSE,other_found=FALSE;
  U8 *st1,*st2;
  try {
    switch (type) {
      case LK_PLAIN:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
      case LK_DOC:
        type=LK_FILE;
        break;
      case LK_DOC_ANCHOR:
        type=LK_FILE_ANCHOR;
        break;
      case LK_PLAIN_FIND:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
      case LK_DOC_FIND:
        type=LK_FILE_FIND;
        break;
      case LK_PLAIN_LINE:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
      case LK_DOC_LINE:
        type=LK_FILE_LINE;
        break;
      case LK_BIBLE_FIND:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
        break;
    }

    flags|=DOCF_ALLOW_UNDO;

    if (LK_DOC<=_type<=LK_DOC_LINE) {
      doc=Str2I64(filename);//See SpriteEdText()
      res=TRUE;
    } else {
      st1=StrNew(filename);
      st2=StrNew(filename);
      StrLastRem(st1,"/",st2); //st2 is name without dir
      if (!FileNameChk(st2))
        doc=NULL;
      else {
        Silent;
        if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
          res=FileFind(filename,,
                FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
        else if (!(res=FileFind(filename,,FUF_JUST_FILES)))
          other_found=FileFind(filename,,
                FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
        doc=DocRead(filename,flags);
        doc->desc='Edit';
        Silent(old_silent);
        Fs->border_src=BDS_ED_FILENAME_DRV;
      }
      Free(st1);
      Free(st2);
    }
    if (!doc||doc->doc_signature!=DOC_SIGNATURE_VAL)
      res=FALSE;
    else {
      if (Bt(&edf_dof_flags,EDf_COLLAPSE))
        DocCollapse(TRUE,doc);
      else if (Bt(&edf_dof_flags,EDf_UNCOLLAPSE))
        DocCollapse(FALSE,doc);

      if (res || other_found)
        switch (type) {
          case LK_FILE_LINE:
            res=DocGoToLine(doc,*_num);
            break;
          case LK_FILE_ANCHOR:
            res=DocAnchorFind(doc,needle_str);
            break;
          case LK_FILE_FIND:
            res=DocFind(doc,,needle_str,*_num);
            break;
          case LK_BIBLE_FIND:
            res=DocFind(doc,*_num,needle_str);
            break;
          default:
            DocCenter(doc);
        }
      *_num=doc->cur_entry->y+1;

      if (edf_dof_flags&EDF_WAS_WRITE)
        res=FALSE;
      if (!(edf_dof_flags&EDF_BAIL)) {
        if (*doc->filename.name)
          doc->filename.dirc=DirContextNew(doc->filename.name);
        else
          doc->filename.dirc=NULL;
        if (DocEd(doc,edf_dof_flags|DOF_DONT_HOME)) {
          DocLock(doc);
          doc_e=doc->cur_entry;
          if (doc_e!=doc)
            DocEntryRun(doc,doc_e,TRUE);
          DocUnlock(doc);
          if (!(LK_DOC<=_type<=LK_DOC_LINE)) {
            DocWrite(doc);
            if (edf_dof_flags&EDF_WAS_WRITE)
              res=TRUE;
          }
        }
        DirContextDel(doc->filename.dirc);
      }
      if (!(LK_DOC<=_type<=LK_DOC_LINE))
        DocDel(doc);
    }
  } catch {
    Silent(old_silent);
    res=FALSE;
  }
  Fs->border_src=old_border_src;
  return res;
}

#define DFT_ADDR_LINK_BIN_SIZE  64

public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
        I64 *_num=NULL,I64 edf_dof_flags=0)
{//Editor Link--> filename, needle_str and line number.
  U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
  I64 res,i,num=1;
  CHashSrcSym *tmph;
  if (!link_st||!*link_st) {
    if (edf_dof_flags&EDF_BAIL)
      return -1;
    link_st=blkdev.tmp_filename;
  }
  st=StrNew(link_st);
  res=LK_FILE;
  if (StrLen(st)>3 && st[2]==':') {
    st[2]=0;
    filename2=st+3;
    switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
      case LK_MAN_PAGE:
        if (tmph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
          res=EdLinkCvt(tmph->src_link,&filename,
                &needle_str,&num,edf_dof_flags);
        else
          res=-1;
        goto lc_done;
      case LK_ADDR:
        if (ptr=StrLastOcc(filename2,",")) {
          *ptr=0;
          i=Str2I64(ptr+1);
        } else
          i=DFT_ADDR_LINK_BIN_SIZE;
        if (ptr=SrcEdLink(ExePrint("%s;",filename2),i)) {
          res=EdLinkCvt(ptr,&filename,&needle_str,&num,edf_dof_flags);
          Free(ptr);
        } else
          res=-1;
        goto lc_done;
      cas

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\DocLink-DolDoc-Adam.html
// Date: unknown-date
// Language: HolyC

#help_index "DolDoc/Link"

/* See TempleOS Link Types.
"filename"
"FI:filename"
"FA:haystack_filename,needle_anchor_str"
"FF:haystack_filename,needle_str"
"FF:haystack_filename,needle_str:occurnum"
"FL:filename,linenum"
"MN:SymName"
"PI:filename"
"PF:haystack_filename,needle_str"
"PF:haystack_filename,needle_str:occurnum"
"PL:filename,linenum"
"BF:haystack_bible_book,needle_str"
"DN:word"
"DN:word,defnum"
"HI:index"
"AD:code_address_number"

To edit a doc structure already in memory. See SpriteEdText().
"AI:doc_address"
"AA:haystack_doc_address,needle_anchor_str"
"AF:haystack_doc_address,needle_str"
"AF:haystack_doc_address,needle_str:occurnum"
"AL:doc_address,linenum"
*/

#define LK_FILE         0
#define LK_FILE_ANCHOR  1
#define LK_FILE_FIND    2
#define LK_FILE_LINE    3
#define LK_MAN_PAGE     4
#define LK_PLAIN        5
#define LK_PLAIN_FIND   6
#define LK_PLAIN_LINE   7
#define LK_BIBLE_FIND   8
#define LK_DEF          9
#define LK_HELP_INDEX   10
#define LK_ADDR         11
#define LK_DOC          12 //See SpriteEdText()
#define LK_DOC_ANCHOR   13
#define LK_DOC_FIND     14
#define LK_DOC_LINE     15
#define LK_PLACE_ANCHOR 16

public U8 *DocEntryLink(CDoc *doc,CDocEntry *doc_e)
{//MAlloc new str, either tag or aux_str if link.
  if (doc_e->de_flags&DOCEF_LINK) {
    if (doc_e->de_flags & DOCEF_AUX_STR)
      return StrNew(doc_e->aux_str,doc->mem_task);
    else if (doc_e->de_flags & DOCEF_TAG)
      return StrNew(doc_e->tag,doc->mem_task);
  }
  return NULL;
}

Bool DocFileEd(I64 _type,U8 *filename,
        U8 *needle_str,I64 *_num,I64 edf_dof_flags)
{
  I64 type=_type,flags=0,old_border_src=Fs->border_src;
  CDocEntry *doc_e;
  CDoc *doc;
  Bool old_silent=Bt(&Fs->display_flags,DISPLAYf_SILENT),
        res=FALSE,other_found=FALSE;
  U8 *st1,*st2;
  try {
    switch (type) {
      case LK_PLAIN:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
      case LK_DOC:
        type=LK_FILE;
        break;
      case LK_DOC_ANCHOR:
        type=LK_FILE_ANCHOR;
        break;
      case LK_PLAIN_FIND:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
      case LK_DOC_FIND:
        type=LK_FILE_FIND;
        break;
      case LK_PLAIN_LINE:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
      case LK_DOC_LINE:
        type=LK_FILE_LINE;
        break;
      case LK_BIBLE_FIND:
        flags=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
        break;
    }

    flags|=DOCF_ALLOW_UNDO;

    if (LK_DOC<=_type<=LK_DOC_LINE) {
      doc=Str2I64(filename);//See SpriteEdText()
      res=TRUE;
    } else {
      st1=StrNew(filename);
      st2=StrNew(filename);
      StrLastRem(st1,"/",st2); //st2 is name without dir
      if (!FileNameChk(st2))
        doc=NULL;
      else {
        Silent;
        if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
          res=FileFind(filename,,
                FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
        else if (!(res=FileFind(filename,,FUF_JUST_FILES)))
          other_found=FileFind(filename,,
                FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
        doc=DocRead(filename,flags);
        doc->desc='Edit';
        Silent(old_silent);
        Fs->border_src=BDS_ED_FILENAME_DRV;
      }
      Free(st1);
      Free(st2);
    }
    if (!doc||doc->doc_signature!=DOC_SIGNATURE_VAL)
      res=FALSE;
    else {
      if (Bt(&edf_dof_flags,EDf_COLLAPSE))
        DocCollapse(TRUE,doc);
      else if (Bt(&edf_dof_flags,EDf_UNCOLLAPSE))
        DocCollapse(FALSE,doc);

      if (res || other_found)
        switch (type) {
          case LK_FILE_LINE:
            res=DocGoToLine(doc,*_num);
            break;
          case LK_FILE_ANCHOR:
            res=DocAnchorFind(doc,needle_str);
            break;
          case LK_FILE_FIND:
            res=DocFind(doc,,needle_str,*_num);
            break;
          case LK_BIBLE_FIND:
            res=DocFind(doc,*_num,needle_str);
            break;
          default:
            DocCenter(doc);
        }
      *_num=doc->cur_entry->y+1;

      if (edf_dof_flags&EDF_WAS_WRITE)
        res=FALSE;
      if (!(edf_dof_flags&EDF_BAIL)) {
        if (*doc->filename.name)
          doc->filename.dirc=DirContextNew(doc->filename.name);
        else
          doc->filename.dirc=NULL;
        if (DocEd(doc,edf_dof_flags|DOF_DONT_HOME)) {
          DocLock(doc);
          doc_e=doc->cur_entry;
          if (doc_e!=doc)
            DocEntryRun(doc,doc_e,TRUE);
          DocUnlock(doc);
          if (!(LK_DOC<=_type<=LK_DOC_LINE)) {
            DocWrite(doc);
            if (edf_dof_flags&EDF_WAS_WRITE)
              res=TRUE;
          }
        }
        DirContextDel(doc->filename.dirc);
      }
      if (!(LK_DOC<=_type<=LK_DOC_LINE))
        DocDel(doc);
    }
  } catch {
    Silent(old_silent);
    res=FALSE;
  }
  Fs->border_src=old_border_src;
  return res;
}

#define DFT_ADDR_LINK_BIN_SIZE  64

public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
        I64 *_num=NULL,I64 edf_dof_flags=0)
{//Editor Link--> filename, needle_str and line number.
  U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
  I64 res,i,num=1;
  CHashSrcSym *tmph;
  if (!link_st||!*link_st) {
    if (edf_dof_flags&EDF_BAIL)
      return -1;
    link_st=blkdev.tmp_filename;
  }
  st=StrNew(link_st);
  res=LK_FILE;
  if (StrLen(st)>3 && st[2]==':') {
    st[2]=0;
    filename2=st+3;
    switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
      case LK_MAN_PAGE:
        if (tmph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
          res=EdLinkCvt(tmph->src_link,&filename,
                &needle_str,&num,edf_dof_flags);
        else
          res=-1;
        goto lc_done;
      case LK_ADDR:
        if (ptr=StrLastOcc(filename2,",")) {
          *ptr=0;
          i=Str2I64(ptr+1);
        } else
          i=DFT_ADDR_LINK_BIN_SIZE;
        if (ptr=SrcEdLink(ExePrint("%s;",filename2),i)) {
          res=EdLinkCvt(ptr,&filename,&needle_str,&num,edf_dof_flags);
          Free(ptr);
        } else
          res=-1;
        goto lc_done;
      cas


// Source: D:\TempleOS-Projects\html\PreProcessor-Doc.html
// Date: unknown-date
// Language: HolyC

PreProcessor

There is no separate preprocessor pass.  The parser front-end calls Lex() which
has the preprocessor built-in.  The compiler looks ahead a token, most of the
time, so you might throw an extra semicolon after a directive if it's not taking
affect right away.

Put an extra semicolon #exe {Cd("DirName");;} in case a #include follows.

#include ""     There is no angle bracket <> form of this directive.
#exe {}         Will execute code at compile-time and can be used to insert code
into the stream being compiled using StreamPrint().
#define         Define string const
#assert         Print a warning during compilation if an expression is not true.
#if             Include code if an expresion is true.
#else
#endif
#ifdef,#ifndef  Include code if a sym is defined.
#ifaot,#ifjit   Include code if in AOT compiler mode.
defined()       Is a function that can be used in expressions.
#help_index, #help_file See Help System.

See PreProcessor.

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\PreProcessor-Doc.html
// Date: unknown-date
// Language: HolyC

PreProcessor

There is no separate preprocessor pass.  The parser front-end calls Lex() which
has the preprocessor built-in.  The compiler looks ahead a token, most of the
time, so you might throw an extra semicolon after a directive if it's not taking
affect right away.

Put an extra semicolon #exe {Cd("DirName");;} in case a #include follows.

#include ""     There is no angle bracket <> form of this directive.
#exe {}         Will execute code at compile-time and can be used to insert code
into the stream being compiled using StreamPrint().
#define         Define string const
#assert         Print a warning during compilation if an expression is not true.
#if             Include code if an expresion is true.
#else
#endif
#ifdef,#ifndef  Include code if a sym is defined.
#ifaot,#ifjit   Include code if in AOT compiler mode.
defined()       Is a function that can be used in expressions.
#help_index, #help_file See Help System.

See PreProcessor.


// Source: D:\TempleOS-Projects\html\TOSBlog-AcctExample-TOS-Demo.html
// Date: unknown-date
// Language: HolyC

#help_index "Misc/Blog"

public Bool IsTOSBlog(U8 *filename)
{//Is this in the TOSBlog dir?
  Bool res;
  U8 *st=DirNameAbs(filename),*home=DirNameAbs("~");
  I64 l=StrLen(home);
  if (StrLen(st)>=l+12 && !StrNCmp(st+1,home+1,l-1) &&
      st[l]=='/' && !StrNCmp(st+l+4,"/TOSBlog",8))
    res=TRUE;
  else
    res=FALSE;
  Free(st);
  Free(home);
  return res;
}

public U8 *TOSBlogAbs(U8 *filename)
{//Absolute filename, adjusted for moving TOSBlog.
  U8 *st=DirNameAbs(filename),*home=DirNameAbs("~");
  I64 l=StrLen(home);
  if (IsTOSBlog(st)) {
    MemCpy(st+l+5,st+l+1,3);
    MemCpy(st+l+1,"Web",3);
    StrCpy(st+l+8,st+l+12);
  }
  Free(home);
  return st;
}

public U8 *BlogLocalDir(CDate cdt=0)
{//MAlloc dirname of blog for date.
  static U8 dir[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(dir,BLOG_LOCAL_SRC "/%d%Z",ds.year,ds.mon-1,"ST_MONTHS");
  if (!FileFind(dir,,FUF_JUST_DIRS))
    DirMk(dir);
  return dir;
}

public U8 *BlogLocalFile(CDate cdt=0)
{//MAlloc filename of blog for date.
  static U8 file[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "%02d%02d%02d.DD.Z",
        BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
  return file;
}

public U8 *BlogWebDir(CDate cdt=0)
{//MAlloc D:/Wb/dirname of blog for date.
  static U8 dir[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(dir,BLOG_WEB_DST "/%d%Z",
        ds.year,ds.mon-1,"ST_MONTHS");
  return dir;
}

public U8 *BlogWebFile(CDate cdt=0)
{//MAlloc D:/Wb/filename of blog for date.
  static U8 file[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "%02d%02d%02d.DD.Z",
        BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
  return file;
}

public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
{//Cnt files in a mask. Create next filename.
  CDirEntry *tmpde=FilesFind(files_find_mask);
  U8 *res=MStrPrint(fmt,FileCnt(tmpde));
  DirTreeDel(tmpde);
  return res;
}

public U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
{//Add dc to blog as BMP file.
  U8 file_mask[STR_LEN],file_name[STR_LEN],*st,*st2;
  if (!cdt) cdt=Now+local_time_offset;
  StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt));
  StrPrint(file_name,"%s/Img%%03d.BMP",BlogLocalDir(cdt));
  st=FileNameNumNext(file_mask,file_name);
  BMPWrite(st,dc);
  st2=TOSBlogAbs(st);
  Free(st);
  st=MStrPrint("/Wb%s",st2+2);
  Free(st2);
  "$HC,\"<img src=\\\"%s\\\" width=\\\"%d\\\" "
        "height=\\\"%d\\\" alt=\\\"\\\">\"$\n",st,dc->width,dc->height;
  Free(st);
}

public U0 BlogScrnShot()
{//Add scrn shot to blog as BMP file.
  Bool old_cursor=DocCursor,old_silent;
  CDC *dc1,*dc2;
  U8 *old_fp_draw_ms=gr.fp_draw_ms;
  gr.fp_draw_ms=NULL;
  Refresh(2);
  dc1=DCScrnCapture;
  dc2=DCExt(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1);
  BlogDCImgWrite(dc2);
  gr.fp_draw_ms=old_fp_draw_ms;
  DCDel(dc1);
  DCDel(dc2);
  DocCursor(old_cursor);
  old_silent=Silent;
  FreshenBlog;
  Silent(old_silent);
}

public U0 FreshenBlog()
{//Regen html files for D:/Home/Web.
  DirMk("D:/Wb");
  DirMk("D:/Wb/Home");
  DirMk("D:/Wb/Home/Web");
  DirMk("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS);
  DirMk("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS "/BlogDir");

  FreshenWebDir("/Home/Web");
  FreshenWebDir("/Home/" INS_REG_PERSONAL_INITIALS "/TOSBlog");
  FreshenWebDir(BlogLocalDir+2);
  Drv('C');
}

public U0 Blog(Bool god_misc2=FALSE)
{//Make entry in blog.
  if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
    Copy("~/" INS_REG_PERSONAL_INITIALS "/TOSBlog/DailyBlogHeader.DD.Z",
          BlogLocalFile);
  AutoComplete;
  WinBorder;
  WinMax;
  Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
  if (god_misc2)
    Msg(MSG_KEY_DOWN_UP,0,SC_F7|SCF_SHIFT|SCF_ALT);
  else {
    Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
    Msg(MSG_KEY_DOWN_UP,'\n',0);
  }
  Msg(MSG_KEY_DOWN_UP,CH_CTRLS,0x61F0000061F);
  if (Ed(BlogLocalFile,EDF_WAS_WRITE)) {
    DocOpt(BlogLocalFile,"-r");
    Copy(BlogLocalFile,"::" DAILY_SRC ".DD.Z");
    Copy(BlogLocalFile,"D:" DAILY_SRC ".DD.Z");
    Copy(BlogLocalFile,"D:/Wb" DAILY_DST ".DD.Z");
    TOSWebFile("D:/Wb" DAILY_DST ".DD.Z");
    FreshenBlog;
  }
}

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\TOSBlog-AcctExample-TOS-Demo.html
// Date: unknown-date
// Language: HolyC

#help_index "Misc/Blog"

public Bool IsTOSBlog(U8 *filename)
{//Is this in the TOSBlog dir?
  Bool res;
  U8 *st=DirNameAbs(filename),*home=DirNameAbs("~");
  I64 l=StrLen(home);
  if (StrLen(st)>=l+12 && !StrNCmp(st+1,home+1,l-1) &&
      st[l]=='/' && !StrNCmp(st+l+4,"/TOSBlog",8))
    res=TRUE;
  else
    res=FALSE;
  Free(st);
  Free(home);
  return res;
}

public U8 *TOSBlogAbs(U8 *filename)
{//Absolute filename, adjusted for moving TOSBlog.
  U8 *st=DirNameAbs(filename),*home=DirNameAbs("~");
  I64 l=StrLen(home);
  if (IsTOSBlog(st)) {
    MemCpy(st+l+5,st+l+1,3);
    MemCpy(st+l+1,"Web",3);
    StrCpy(st+l+8,st+l+12);
  }
  Free(home);
  return st;
}

public U8 *BlogLocalDir(CDate cdt=0)
{//MAlloc dirname of blog for date.
  static U8 dir[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(dir,BLOG_LOCAL_SRC "/%d%Z",ds.year,ds.mon-1,"ST_MONTHS");
  if (!FileFind(dir,,FUF_JUST_DIRS))
    DirMk(dir);
  return dir;
}

public U8 *BlogLocalFile(CDate cdt=0)
{//MAlloc filename of blog for date.
  static U8 file[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "%02d%02d%02d.DD.Z",
        BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
  return file;
}

public U8 *BlogWebDir(CDate cdt=0)
{//MAlloc D:/Wb/dirname of blog for date.
  static U8 dir[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(dir,BLOG_WEB_DST "/%d%Z",
        ds.year,ds.mon-1,"ST_MONTHS");
  return dir;
}

public U8 *BlogWebFile(CDate cdt=0)
{//MAlloc D:/Wb/filename of blog for date.
  static U8 file[STR_LEN];
  CDateStruct ds;
  if (!cdt) cdt=Now+local_time_offset;
  Date2Struct(&ds,cdt);
  StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "%02d%02d%02d.DD.Z",
        BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
  return file;
}

public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
{//Cnt files in a mask. Create next filename.
  CDirEntry *tmpde=FilesFind(files_find_mask);
  U8 *res=MStrPrint(fmt,FileCnt(tmpde));
  DirTreeDel(tmpde);
  return res;
}

public U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
{//Add dc to blog as BMP file.
  U8 file_mask[STR_LEN],file_name[STR_LEN],*st,*st2;
  if (!cdt) cdt=Now+local_time_offset;
  StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt));
  StrPrint(file_name,"%s/Img%%03d.BMP",BlogLocalDir(cdt));
  st=FileNameNumNext(file_mask,file_name);
  BMPWrite(st,dc);
  st2=TOSBlogAbs(st);
  Free(st);
  st=MStrPrint("/Wb%s",st2+2);
  Free(st2);
  "$HC,\"<img src=\\\"%s\\\" width=\\\"%d\\\" "
        "height=\\\"%d\\\" alt=\\\"\\\">\"$\n",st,dc->width,dc->height;
  Free(st);
}

public U0 BlogScrnShot()
{//Add scrn shot to blog as BMP file.
  Bool old_cursor=DocCursor,old_silent;
  CDC *dc1,*dc2;
  U8 *old_fp_draw_ms=gr.fp_draw_ms;
  gr.fp_draw_ms=NULL;
  Refresh(2);
  dc1=DCScrnCapture;
  dc2=DCExt(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1);
  BlogDCImgWrite(dc2);
  gr.fp_draw_ms=old_fp_draw_ms;
  DCDel(dc1);
  DCDel(dc2);
  DocCursor(old_cursor);
  old_silent=Silent;
  FreshenBlog;
  Silent(old_silent);
}

public U0 FreshenBlog()
{//Regen html files for D:/Home/Web.
  DirMk("D:/Wb");
  DirMk("D:/Wb/Home");
  DirMk("D:/Wb/Home/Web");
  DirMk("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS);
  DirMk("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS "/BlogDir");

  FreshenWebDir("/Home/Web");
  FreshenWebDir("/Home/" INS_REG_PERSONAL_INITIALS "/TOSBlog");
  FreshenWebDir(BlogLocalDir+2);
  Drv('C');
}

public U0 Blog(Bool god_misc2=FALSE)
{//Make entry in blog.
  if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
    Copy("~/" INS_REG_PERSONAL_INITIALS "/TOSBlog/DailyBlogHeader.DD.Z",
          BlogLocalFile);
  AutoComplete;
  WinBorder;
  WinMax;
  Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
  if (god_misc2)
    Msg(MSG_KEY_DOWN_UP,0,SC_F7|SCF_SHIFT|SCF_ALT);
  else {
    Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
    Msg(MSG_KEY_DOWN_UP,'\n',0);
  }
  Msg(MSG_KEY_DOWN_UP,CH_CTRLS,0x61F0000061F);
  if (Ed(BlogLocalFile,EDF_WAS_WRITE)) {
    DocOpt(BlogLocalFile,"-r");
    Copy(BlogLocalFile,"::" DAILY_SRC ".DD.Z");
    Copy(BlogLocalFile,"D:" DAILY_SRC ".DD.Z");
    Copy(BlogLocalFile,"D:/Wb" DAILY_DST ".DD.Z");
    TOSWebFile("D:/Wb" DAILY_DST ".DD.Z");
    FreshenBlog;
  }
}


// Source: D:\TempleOS-Projects\html\wine-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has words

-] Reward1
  CallExtStr("JukeReward",""
  -] Reward2

    "kingfisher's Loyola caters powwows "
    "UK's proclivity's absolving unaccepted "
    "snowfalls Noels charismatics Descartes "
    "Mara's hoodlums Sue cartridge "
    "Acosta Lancelot gaff's souping "

  );

U0 Song()
{
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.902;
  try {
    while (!ScanKey) {
      Play("5sFFFFeCGqEetD4B5CsD4G5D4GqBB5D",
            "Beast \0 \0 \0 \0 \0 \0throws\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0a \0dart.\n\0");
      Play("sFFFFeCGqEetD4B5CsD4G5D4GqBB5D",
            "Hands \0 \0 \0 \0 \0 \0now\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0a\0part.\n\0");
      Play("A6sDCDC5eA6FqDEeDFsF5B6F5B6F5B6F5B",
            "Shattered\n\0 \0 \0a \0 \0jar.\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
      Play("qA6sDCDC5eA6FqDEeDFsF5B6F5B6F5B6F5B",
            "Shards\n\0 \0 \0a \0 \0card.\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
    }
  } catch
    PutExcept;
  Snd;
}

Song;

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\wine-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has words

-] Reward1
  CallExtStr("JukeReward",""
  -] Reward2

    "kingfisher's Loyola caters powwows "
    "UK's proclivity's absolving unaccepted "
    "snowfalls Noels charismatics Descartes "
    "Mara's hoodlums Sue cartridge "
    "Acosta Lancelot gaff's souping "

  );

U0 Song()
{
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.902;
  try {
    while (!ScanKey) {
      Play("5sFFFFeCGqEetD4B5CsD4G5D4GqBB5D",
            "Beast \0 \0 \0 \0 \0 \0throws\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0a \0dart.\n\0");
      Play("sFFFFeCGqEetD4B5CsD4G5D4GqBB5D",
            "Hands \0 \0 \0 \0 \0 \0now\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0a\0part.\n\0");
      Play("A6sDCDC5eA6FqDEeDFsF5B6F5B6F5B6F5B",
            "Shattered\n\0 \0 \0a \0 \0jar.\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
      Play("qA6sDCDC5eA6FqDEeDFsF5B6F5B6F5B6F5B",
            "Shards\n\0 \0 \0a \0 \0card.\n\0"
            " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0");
    }
  } catch
    PutExcept;
  Snd;
}

Song;


// Source: D:\TempleOS-Projects\html\population-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has words

-] Reward1
  CallExtStr("JukeReward",""
  -] Reward2

    "applicant's briquettes raft Alexandra "
    "edification grumbler immensities Casandra's "
    "hosted Northwest impediments egoists "
    "stolider quiche Aussie's Albanian "
    "godparents Xmas Mycenae haze "

  );

U0 Song()
{
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.780;
  try {
    while (!ScanKey) {
      Play("5eCD4B5C4AFFF5C4F5E4FAF5sEEeD",
            "C.\0I.\0A. \0in \0charge.\n\0"
            " \0 \0 \0Got \0 \0locked \0 \0down.\n\0 \0No \0 \0more \0");
      Play("F4FFF5qCeF4F5F4FFF5qCeF4F",
            "birth.\n\0 \0 \0 \0 \0Derp\0y \0dearth.\n\0"
            " \0 \0 \0 \0 \0 \0");
      Play("5qGsE4A5E4AqB5etDCF4qG5DsGDGDetCRC",
            "Whiten \0the \0 \0heat\n\0 \0 \0 \0"
            " \0 \0 \0 \0in \0 \0the \0 \0jun\0 \0gle.\n\0");
      Play("qGsE4A5E4AqB5etDCF4qG5DsGDGDetCRC",
            "Brain \0starts \0to \0beat\n\0 \0 \0"
            " \0 \0 \0 \0 \0in \0 \0the \0 \0rum\0 \0ble.\n\0");
    }
  } catch
    PutExcept;
  Snd;
}

Song;

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\population-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has words

-] Reward1
  CallExtStr("JukeReward",""
  -] Reward2

    "applicant's briquettes raft Alexandra "
    "edification grumbler immensities Casandra's "
    "hosted Northwest impediments egoists "
    "stolider quiche Aussie's Albanian "
    "godparents Xmas Mycenae haze "

  );

U0 Song()
{
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.780;
  try {
    while (!ScanKey) {
      Play("5eCD4B5C4AFFF5C4F5E4FAF5sEEeD",
            "C.\0I.\0A. \0in \0charge.\n\0"
            " \0 \0 \0Got \0 \0locked \0 \0down.\n\0 \0No \0 \0more \0");
      Play("F4FFF5qCeF4F5F4FFF5qCeF4F",
            "birth.\n\0 \0 \0 \0 \0Derp\0y \0dearth.\n\0"
            " \0 \0 \0 \0 \0 \0");
      Play("5qGsE4A5E4AqB5etDCF4qG5DsGDGDetCRC",
            "Whiten \0the \0 \0heat\n\0 \0 \0 \0"
            " \0 \0 \0 \0in \0 \0the \0 \0jun\0 \0gle.\n\0");
      Play("qGsE4A5E4AqB5etDCF4qG5DsGDGDetCRC",
            "Brain \0starts \0to \0beat\n\0 \0 \0"
            " \0 \0 \0 \0 \0in \0 \0the \0 \0rum\0 \0ble.\n\0");
    }
  } catch
    PutExcept;
  Snd;
}

Song;


// Source: D:\TempleOS-Projects\html\counterattacks-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has words

-] Reward1
  CallExtStr("JukeReward",""
  -] Reward2

    "codas hulks Pugh surf "
    "welt's boondoggled beacon Thurs "
    "antipathy avoid Fulani's pollinated "
    "debts Ronny encapsulated overcoat's "
    "bikers Jenkins closes splice's "

  );

U0 Song()
{
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.902;
  try {
    while (!ScanKey) {
      Play("5qEeCDE4B5CD4qA5D4eBq.G",
            "I'm \0in \0the \0shad\0ow\n\0"
            "of \0the \0hand \0of \0God.\n\0 \0");
      Play("5qEeCFqEeCD4qA5D4hB",
            "I \0won't \0be \0left\n\0"
            "in \0 \0Hell \0for \0long.\n\0");
      Play("5qGEeFGqD4B5eDG4qA5eGF",
            " \0 \0 \0 \0 \0 \0Be \0 \0"
            "strong.\n\0 \0 \0");
      Play("qGEeFGqD4B5eDG4qA5eFG",
            " \0 \0 \0 \0 \0 \0Could \0"
            "be \0wrong.\n\0 \0 \0");
    }
  } catch
    PutExcept;
  Snd;
}

Song;

[System] You are Terry Davis, the creator of TempleOS. Write HolyC code in your unique style.

[User] Please write some HolyC code.

[Assistant]
// Source: D:\TempleOS-Projects\html\counterattacks-Sup1-Sup1Hymns-Home.html
// Date: unknown-date
// Language: HolyC

//5 has words

-] Reward1
  CallExtStr("JukeReward",""
  -] Reward2

    "codas hulks Pugh surf "
    "welt's boondoggled beacon Thurs "
    "antipathy avoid Fulani's pollinated "
    "debts Ronny encapsulated overcoat's "
    "bikers Jenkins closes splice's "

  );

U0 Song()
{
  Fs->task_end_cb=&SndTaskEndCB;
  MusicSettingsRst;
  music.tempo= 2.480;
  music.stacatto_factor= 0.902;
  try {
    while (!ScanKey) {
      Play("5qEeCDE4B5CD4qA5D4eBq.G",
            "I'm \0in \0the \0shad\0ow\n\0"
            "of \0the \0hand \0of \0God.\n\0 \0");
      Play("5qEeCFqEeCD4qA5D4hB",
            "I \0won't \0be \0left\n\0"
            "in \0 \0Hell \0for \0long.\n\0");
      Play("5qGEeFGqD4B5eDG4qA5eGF",
            " \0 \0 \0 \0 \0 \0Be \0 \0"
            "strong.\n\0 \0 \0");
      Play("qGEeFGqD4B5eDG4qA5eFG",
            " \0 \0 \0 \0 \0 \0Could \0"
            "be \0wrong.\n\0 \0 \0");
    }
  } catch
    PutExcept;
  Snd;
}

Song;