• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

All hail working code blocks!!!

Cogman

Lifer
Perhaps the feature I've been drooling over the most. Working code blocks!!. Post your code here in memory of fusetalks broken code blocks

Code:
#include <iostream>
using namespace std;

int main()
{
    cout << "Hello vb Forums\nGoodbye crappy fusetalk code enclosures!\n";
}
 
NM. Turns out there was just an exceptionally long delay before the thread appeared.
 
Last edited:
Code:
for(int i = 0; i < 10; ++i)
    array[i][b] = 10;

<stars attr="test">
    <star>sol</star>
</stars>

a
 a
  a
   a
    a
   a
  a
 a
a

yay
 
It would be nice if there line numbers that were shown on the display but not stored with the code entry. That would keep it easy to edit and quote the code while still providing for line numbers for reference in the posts.

That would probably be easy to do using a greasemonkey script....

Code:
module AT
where

odd n =
    if (n == 0) then
    False
    else
    AT.even (n-1)
even n =
    if (n == 0) then
    True
    else
    AT.odd (n-1)
 
Wow I forgot about that. This is definably a good thing. Bolding only goes so far to post code.


*random code from first thing that happens to be already open*
Code:
		//--- SQL stuff
		private SQLsaveState m_SaveState=SQLsaveState.Unset;
		
		[CommandProperty( AccessLevel.GameMaster )]
		public SQLsaveState SaveState
		{
			get { return m_SaveState; }
			set {				
				System.Debugger.Write("itemsavestate_called","{0} changed from ({1} to {2})",this,m_SaveState,value);
			
				if(value!=m_SaveState)
				{
					System.Debugger.Write("itemsavestate_called","{0} changed from ({1} to {2}) - check1 passed",this,m_SaveState,value);
					if(value!=SQLsaveState.Unchanged)
					{
						System.Debugger.Write("itemsavestate_called","{0} changed from ({1} to {2}) - check2 passed",this,m_SaveState,value);
						Item tmp=null;
						bool doadd=true;
						if(World.ChangedItems.TryGetValue(this.Serial,out tmp))
						{
							if(tmp==this)doadd=false;
						}
						
						if(doadd)
						{
							System.Debugger.Write("itemsavestate_called","{0} changed from ({1} to {2}) - check3 passed",this,m_SaveState,value);
							lock(World.ChangedItems)
							{
								System.Debugger.Write("itemsavestate","Adding {0} to changed list ({1} to {2})",this,m_SaveState,value);
								World.ChangedItems[this.Serial] = this;	
							}
						}				
					}
				
					m_SaveState=value; 
				}
			}
		}
		
		
		
		//call this whenever the object gets modified so we can properly set the sql save state
		public void Modify()
		{			
			System.Debugger.Write("modifyitem_called",false,"{0} Modified (Item)",this);
			if(!World.Loaded)return; //don't do anything at world load or everything ends up getting changed
			if(!World.StopSaving && (SaveState==SQLsaveState.Unchanged))
			{
				SaveState=SQLsaveState.Changed;
				System.Debugger.Write("modifyitem",false,"{0} Modified (Item)",this);
			}
		}
				
		
		//--- end SQL stuff

Yay!
 
I think you guys may be overreacting. I mean, what's it been? Three, maybe four years...

Code:
#define P(X)j=write(1,X,1)
#define C 39
int M[5000]={2},*u=M,N[5000],R=22,a[4],l[]={0,-1,C-1,-1},m[]={1,-C,-1,C},*b=N,
*d=N,c,e,f,g,i,j,k,s;main(){for(M[i=C*R-1]=24;f|d>=b;){c=M[g=i];i=e;for(s=f=0;
s<4;s++)if((k=m[s]+g)>=0&&k<C*R&&l[s]!=k%C&&(!M[k]||!j&&c>=16!=M[k]>=16))a[f++
]=s;if(f){f=M[e=m[s=a[rand()/(1+2147483647/f)]]+g];j=j<f?f:j;f+=c&-16*!j;M[g]=
c|1<<s;M[*d++=e]=f|1<<(s+2)%4;}else e=d>b++?b[-1]:e;}P(" ");for(s=C;--s;P("_")
)P(" ");for(;P("\n"),R--;P("|"))for(e=C;e--;P("_ "+(*u++/8)%2))P("| "+(*u/4)%2
);}
 
Last edited:
I think you guys may be overreacting. I mean, what's it been? Three, maybe four years...

Code:
#define P(X)j=write(1,X,1)
#define C 39
int M[5000]={2},*u=M,N[5000],R=22,a[4],l[]={0,-1,C-1,-1},m[]={1,-C,-1,C},*b=N,
*d=N,c,e,f,g,i,j,k,s;main(){for(M[i=C*R-1]=24;f|d>=b;){c=M[g=i];i=e;for(s=f=0;
s<4;s++)if((k=m[s]+g)>=0&&k<C*R&&l[s]!=k%C&&(!M[k]||!j&&c>=16!=M[k]>=16))a[f++
]=s;if(f){f=M[e=m[s=a[rand()/(1+2147483647/f)]]+g];j=j<f?f:j;f+=c&-16*!j;M[g]=
c|1<<s;M[*d++=e]=f|1<<(s+2)%4;}else e=d>b++?b[-1]:e;}P(" ");for(s=C;--s;P("_")
)P(" ");for(;P("\n"),R--;P("|"))for(e=C;e--;P("_ "+(*u++/8)%2))P("| "+(*u/4)%2
);}

😱 Nooo, Fusetalk is back! Quick, Kill it before it takes over again 😛
 
Haha, fear not. Here is the line of text that originally appeared above that code block:

The following program, by Carl Shapiro, won the Grand Prize for most well-rounded in confusion of the 1985 International Obfuscated C Code Contest
 
Code:
/*

            &#9617;&#9608;&#9608;&#9608;&#9608;&#9617;    &#9617;&#9608;&#9608;&#9608;&#9608;&#9617;
            &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;    &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;     &#9608;&#9608;
           &#9618;&#9608;&#9608;  &#9608;&#9608;&#9618;  &#9618;&#9608;&#9608;  &#9608;&#9608;&#9618;    &#9608;&#9608;
&#9608;&#9608;      &#9608;&#9608; &#9608;&#9608;&#9618;  &#9618;&#9608;&#9608;  &#9608;&#9608;&#9618;  &#9618;&#9608;&#9608;  &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;
&#9608;&#9608;&#9617;    &#9617;&#9608;&#9608; &#9608;&#9608;    &#9608;&#9608;  &#9608;&#9608;    &#9608;&#9608;  &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;
&#9619;&#9608;&#9618; &#9608;&#9608; &#9618;&#9608;&#9619; &#9608;&#9608; &#9608;&#9608; &#9608;&#9608;  &#9608;&#9608; &#9608;&#9608; &#9608;&#9608;    &#9608;&#9608;
&#9618;&#9608;&#9618;&#9617;&#9608;&#9608;&#9617;&#9618;&#9608;&#9618; &#9608;&#9608; &#9608;&#9608; &#9608;&#9608;  &#9608;&#9608; &#9608;&#9608; &#9608;&#9608;    &#9608;&#9608;
 &#9608;&#9619;&#9618;&#9608;&#9608;&#9618;&#9608;&#9608;  &#9608;&#9608;    &#9608;&#9608;  &#9608;&#9608;    &#9608;&#9608;    &#9608;&#9608;
 &#9608;&#9608;&#9619;&#9608;&#9608;&#9619;&#9608;&#9608;  &#9608;&#9608;&#9618;  &#9618;&#9608;&#9608;  &#9608;&#9608;&#9618;  &#9618;&#9608;&#9608;    &#9608;&#9608;
 &#9608;&#9608;&#9608;&#9618;&#9618;&#9608;&#9608;&#9619;  &#9618;&#9608;&#9608;  &#9608;&#9608;&#9618;  &#9618;&#9608;&#9608;  &#9608;&#9608;&#9618;    &#9608;&#9608;&#9617;
 &#9618;&#9608;&#9608;&#9617;&#9617;&#9608;&#9608;&#9618;   &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;    &#9608;&#9608;&#9608;&#9608;&#9608;&#9608;     &#9608;&#9608;&#9608;&#9608;&#9608;
 &#9617;&#9608;&#9608;  &#9608;&#9608;    &#9617;&#9608;&#9608;&#9608;&#9608;&#9617;    &#9617;&#9608;&#9608;&#9608;&#9608;&#9617;     &#9617;&#9608;&#9608;&#9608;&#9608;

*/
 
Hmm I was pretty sure vb had code coloring in by default. Suppose that could be coded in, but it's not easy. TONS of regex, but doable.
 
Back
Top