.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > YappA > Offtopic
Offtopic Just anything. You have time to waste ? Prove it !!!

Reply
 
Thread Tools
Do NOT use CODE tag for posting source code
Old
  (#1)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Do NOT use CODE tag for posting source code - 06-01-2004

Do NOT use CODE tag for posting source code

Code:
// THIS PIECE OF CODE MAKES NO SENSE:
void BotThink( cBot *pBot )
{ 
   printf("testing string highlighting %d",1);
   int too_bad_number_are_not_highlighted = 12345;
   // STEP 1: Update status
   pBot->UpdateStatus(); 
   // PASS THROUGH ENGINE
   if((keywords_were_blue)&&(variables_were_not)) {
		I_would_be_happy = TRUE;
   }
   /* another comment */
   return;
}
use PHP tag instead :

PHP Code:
// THIS PIECE OF CODE MAKES NO SENSE:
void BotThinkcBot *pBot )

   
printf("testing string highlighting %d",1);
   
int too_bad_number_are_not_highlighted 12345;
   
// STEP 1: Update status
   
pBot->UpdateStatus(); 
   
// PASS THROUGH ENGINE
   
if((keywords_were_blue)&&(variables_were_not)) {
        
I_would_be_happy TRUE;
   }
   
/* another comment */
   
return;



kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)

Last edited by koraX; 06-01-2004 at 10:00..
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Do NOT use CODE tag for posting source code - 06-01-2004

, neat stuff indeed !
I wonder if I could not hack the PHP scripts to have colors inside [ code ] tags as well...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#3)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Do NOT use CODE tag for posting source code - 07-01-2004

,yeah, and when you're on it, make the colors more msvc like


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#4)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

nice!


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#5)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

highlight_string() is the php function your looking for.






  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#6)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

Some people (like me) think the colored text is HARDER (not easier) to read.

botman
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

even with neat colors, ladies ?
Code:
// hello, I'm a comment
#include <stuff.h> /* is the include blue ? */
 
float main (beer_t bHeineken)
{
   printf ("burp\n"); // strings should be red, somehow
 
   return; // and God said: Thou Shall Be Blue.
}
 
/*
 * so who's the boss, stupid PHP?
 */



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#8)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

and now with the punctuation blue color removed...
Code:
// hello, I'm a comment
#include <stuff.h> /* is the include blue ? */
 
float main (beer_t bHeineken)
{
   printf ("burp\n"); // strings should be red, somehow
 
   return; // and God said: Thou Shall Be Blue.
}
 
/*
 * so who's the boss, stupid PHP?
 */
darn, it's quite hard to override PHP



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#9)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

lets see if it works

Code:
#include <stdio.h>
 
int main(void)
{
int just_a_number = 5;
printf("Some ugly text %d\n",just_a_number);
while(getchar()!='\n'); // hmm seems like there has to be a space after while
return -1;
}
 
if while for switch case break continue
 
int char BYTE BOOL float double TRUE FALSE // highlight theses too
 
1 2 3 -4 5.6 // highlight numbers with red for example
this is how it looks in my MSVC


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)

Last edited by koraX; 08-01-2004 at 09:24..
  
Reply With Quote
Re: Do NOT use CODE tag for posting source code
Old
  (#10)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: Do NOT use CODE tag for posting source code - 08-01-2004

And there is a big bug IMO in code tag, when you copy it (select with mouse and CTRL-C) and then you paste it somewhere (MSVC or Far manager) no 'enters' are copied. No '\n' char, no 0D or 0D 0A chars o_O
Example :


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com