Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - blue_bear_94

Pages: 1 ... 41 42 [43] 44 45 ... 68
631
Art / Re: General purpose art thread
« on: August 01, 2012, 08:26:01 pm »

May I ask what you mean by Touhou illustrations??


I infer that they're illustrations of Touhou characters?

632
Introduce Yourself! / Re: A wild nyanfly appeared!
« on: August 01, 2012, 08:23:02 pm »
Yes. If I had one advice for you, get a Casio Prizm.

633
Introduce Yourself! / Re: A wild nyanfly appeared!
« on: August 01, 2012, 08:19:08 pm »
What OS do you have? The latest Ndless release is 3.1.

634
Humour and Jokes / Re: Derpy Astley
« on: August 01, 2012, 08:11:45 pm »
True, we're about calculators at the core.
* blue_bear_94 lost

635
TI Z80 / Re: Tokens
« on: August 01, 2012, 11:09:26 am »
As a sidenote, how do you insert the actual ~ token?

636
Site Feedback and Questions / Re: Under 50 posts/day??? Yikes!
« on: July 31, 2012, 01:29:42 pm »
Lack of a standard print() function? (Without Ndless) Inability to read/write files? (Without Ndless) Annoying bar at the top of the screen? (Also without Ndless)

You really don't need a print() function or the ability to read/write files to make a decent game. The annoying bar can be removed in 3.1 WITHOUT ndless. Levak does that with nyan cat. Seriously, Nspire Lua can do plenty of things...


I stand corrected.

637
Site Feedback and Questions / Re: Under 50 posts/day??? Yikes!
« on: July 31, 2012, 10:37:10 am »
Lack of a standard print() function? (Without Ndless) Inability to read/write files? (Without Ndless) Annoying bar at the top of the screen? (Also without Ndless)

638
Calculator C / Re: [68k] Flood Fill
« on: July 30, 2012, 01:45:32 pm »
It fills a few pixels then hangs; try it on TIEmu to see how (New>OK>Fill).

Edit: Binary.

Edit 2: Here is documentation for GetGPix and DrawGPix.

GetGPix(int x, int y) returns the color of the pixel at the point (x,y). 0 is white, and 3 is black.

SetGPix(int x, int y, int color, int attr) draws a pixel at the point (x,y) using the color specified. The attr argument means:
GA_DRAW: Replaces the color.
GA_ROTATE: Rotates the color.
GA_FLIP: Inverts. The color is disregarded in this drawing mode.

639
Calculator C / [68k] Flood Fill
« on: July 29, 2012, 09:12:42 pm »
I was trying to implement flood filling with the right-hand algorithm (http://en.wikipedia.org/wiki/Flood_fill#Fixed_memory_method_.28right-hand_fill_method.29), but it don't seem to work. Here's the code specific to the flood filling:

Code: [Select]
typedef struct {
int x,y,dir;
} pt;
enum {LEFT,UP,RIGHT,DOWN};
#define DEF_DIR DOWN
#define PT_NULL (pt){-20,-20,0}
#define pteq(pt1,pt2) (pt1.x==pt2.x)&&(pt1.y==pt2.y)&&(pt1.dir==pt2.dir)
#define pteqc(pt1,pt2) (pt1.x==pt2.x)&&(pt1.y==pt2.y)
#define ptcolor(Pt) (Pt.x>=0&&Pt.x<whole_scn->xy.x1&&Pt.y>=0&&Pt.y<whole_scn->xy.y1)?GetGPix(Pt.x,Pt.y):mf
#define nextdir(Dir) (Dir+1)%4
#define prevdir(Dir) (Dir+3)%4
#define oppdir(Dir) (Dir+2)%4
int mf=3;
void FillPt(pt Pt,int col)
{
int w=whole_scn->xy.x1;
int h=whole_scn->xy.y1;
if (Pt.x>=0&&Pt.x<w&&Pt.y>=0&&Pt.y<h)
DrawGPix(Pt.x,Pt.y,col,GA_DRAW);
}
pt ptDir(pt Pt,int Dir)
{
switch (Dir)
{
case LEFT:
Pt.x--;
break;
case RIGHT:
Pt.x++;
break;
case UP:
Pt.y--;
break;
case DOWN:
Pt.y++;
break;
}
return Pt;
}
#define ptdir ptDir
pt inFront(pt Pt)
{
return ptDir(Pt,Pt.dir);
}
void FloodFill(short x,short y,short tcol, short rcol)
{
mf=rcol;
pt cur={x,y,DEF_DIR};
pt mark=PT_NULL;
pt mark2=PT_NULL;
//save marks
pt md=PT_NULL;
pt md2=PT_NULL;
int backtrack=0;
int findloop=0;
int count=0;
int temp;
//while front pixel is empty.........move forward
while (ptcolor(inFront(cur))==tcol) cur=inFront(cur);
goto START;
MAIN://MAIN LOOP!
cur=inFront(cur);//move forward
//if right pixel is empty
if (ptcolor(ptDir(cur,nextdir(cur.dir)))==tcol)
{
//if backtrack is true and findloop is false
//and either front pixel or left pixel is empty
//set findloop to true
if (backtrack && !findloop && ((ptcolor(inFront(cur))==tcol)||(ptcolor(ptDir(cur,prevdir(cur.dir)))==tcol))) findloop=1;
//turn right
cur.dir=nextdir(cur.dir);
PAINT:
//move forward
//FillPt(cur,rcol);
cur=inFront(cur);
}
START:
//set count to # of nondiagonally adjacent pixels filled
count=(ptcolor(inFront(cur))!=tcol)+(ptcolor(ptDir(cur,prevdir(cur.dir)))!=tcol)+(ptcolor(ptDir(cur,nextdir(cur.dir)))!=tcol)+(ptcolor(ptDir(cur,oppdir(cur.dir)))!=tcol);
if (count!=4)
{
do {
cur.dir=nextdir(cur.dir);//turn right
} while(ptcolor(inFront(cur))==tcol);//front pixel is empty
do {
cur.dir=prevdir(cur.dir);//turn left
} while(ptcolor(inFront(cur))!=tcol);//front pixel is filled
}
switch (count)
{
case 1:
if (backtrack) findloop=1;
else if (findloop)
{
//if mark is null........restore mark
if (pteq(mark,PT_NULL)) mark=md;
}
else if ((ptcolor(ptdir(inFront(cur),prevdir(cur.dir)))==tcol)&&(ptcolor(ptdir(ptdir(cur,oppdir(cur.dir)),prevdir(cur.dir)))==tcol))
{//front left pixel and back left pixel are both empty
md=mark;//save mark
mark=PT_NULL;//clear mark
cur.dir=prevdir(cur.dir);//turn left
FillPt(cur,rcol);//fill cur
goto PAINT;
}
break;
case 2:
//if back pixel is filled
if (ptcolor(ptdir(cur,oppdir(cur.dir)))!=tcol)
{
//if front left pixel is not filled
if (ptcolor(ptdir(inFront(cur),prevdir(cur.dir)))==tcol)
{
//save mark
md=mark;
//clear mark
mark=PT_NULL;
//turn around
cur.dir=oppdir(cur.dir);
//fill cur
FillPt(cur,rcol);
goto PAINT;
}
}
else if (pteq(mark,PT_NULL))//mark is not set
{
mark=cur;//set mark to cur
md2=mark2;
mark2=PT_NULL;//clear mark2
findloop=0;
backtrack=0;
}
else
{
if (pteq(mark2,PT_NULL))//if mark2 is not set
{
if (pteqc(cur,mark))//if cur is at mark
{
if (cur.dir==mark.dir)//if cur-dir==mark-dir
{
md=mark;
mark=PT_NULL;//clear mark
cur.dir=oppdir(mark.dir);//turn around
goto PAINT;
}
else
{
backtrack=1;
findloop=0;
cur.dir=mark.dir;
}
}
else if (findloop)
{
mark2=cur;//set mark2 to cur, set mark2-dir to cur-dir
}
}
else
{
if (pteqc(cur,mark))//if cur is at mark
{
cur=mark2;//set cur to mark2, set cur-dir to mark2-dir
md=mark;
md2=mark2;
mark=PT_NULL;
mark2=PT_NULL;//clear mark and mark2
backtrack=0;
cur.dir=oppdir(cur.dir);//turn around
FillPt(cur,rcol);//fill cur
goto PAINT;
}
else if (pteqc(cur,mark2))//if cur is at mark2
{
temp=mark.dir;//set mark to cur
mark=cur;
mark.dir=temp;
cur.dir=mark2.dir;//set cur-dir and mark-dir to
mark.dir=mark2.dir;//mark2-dir
md2=mark2;
mark2=PT_NULL;//clear mark2
}
}
}
break;
case 3:
md=mark;
mark=PT_NULL;//clear mark
cur.dir=prevdir(cur.dir);//fill cur
FillPt(cur,rcol);
goto PAINT;
break;
case 4:
FillPt(cur,rcol);//fill cur
return;//done
break;
}
goto MAIN;
}
#define Fill(x,y,col) FloodFill(x,y,GetGPix(x,y),col)
Is there anything I did wrong? (The full source is attached.) Thanks for helping me.

640
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: July 29, 2012, 08:33:15 pm »
3120: and at least two of them are not TIs

641
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: July 29, 2012, 08:22:53 pm »
3118: my dog has one calc: the casio prizm

642
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: July 29, 2012, 08:01:08 pm »
3115: Your cat is a member of U. C. C. P.

643
Art / Re: General purpose art thread
« on: July 27, 2012, 10:51:23 pm »
Here is a poster of a TI-89 Titanium (incomplete).
Also, I included something more.

644
News / Re: Omnimaga Programming Contest 2012: Artificial Intelligence
« on: July 26, 2012, 01:24:40 am »
Axe is a calculator language. There are few, if any, paying jobs for programming calcs. C, however, is used for computers as well.

645
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: July 26, 2012, 12:42:42 am »
3090: You spend 50% of your income on calcs and calc related stuff.

Pages: 1 ... 41 42 [43] 44 45 ... 68