Page 1 of 3

C++/C/Pascal/basic/etc...

Posted: Thu Oct 20, 2011 2:48 pm
by Lanac
So, I took programming in my school(it was an option, wasnt needed), I started learning c++, and im failing hard on simplest tasks since i dont under stand some things, which is probably happening becouse my lack of concentration. I know the commands, but i cant put what is needed in task in the command, so I am asking is anyone willing of helping me via text, skype or whatever?

Posted: Thu Oct 20, 2011 4:28 pm
by pmd
c++ are sophisticated. especially pure. the acrobatics with strings are so epic.

Posted: Thu Oct 20, 2011 4:54 pm
by Redman
pmd wrote:c++ are sophisticated. especially pure. the acrobatics with strings are so epic.
What? C / C++ is very easy. Here's an example:

Code: Select all

#include <ncurses.h>/*****************************************************/
            int               m&#91;256                   &#93; &#91;         256   &#93;,a
 ,b   ;;;   ;;;   WINDOW*w;   char*l=""   "\176qxl"   "q"   "q"   "k"   "w\
xm"   "x"   "t"         "j"         "v"         "u"         "n"         ,Q&#91;
 &#93;=   "Z"   "pt!ftd`"   "qdc!`eu"   "dq!$c!nnwf"/**   ***   */"t\040\t";c&#40;
int   u ,         int         v&#41;&#123;                     v?m   &#91;u&#93;         &#91;v-
 1&#93;   |=2,m&#91;u&#93;&#91;v-1&#93; &   48?W&#93;&#91;v-1   &#93; &   15&#93;&#93;&#41;&#58;0&#58;0;u?m&#91;u   -1&#93;&#91;v&#93;|=1   ,m&#91;
 u-               1&#93;&#91;   v&#93;&         48?               W-1   &#93;&#91;v         &#93;&
15&#93;   &#93;&#41;&#58;0&#58;0;v<   255   ?m&#91;   u&#93;&#91;v+1&#93;|=8,m&#91;u&#93;&#91;v+1&#93;&   48?   W&#93;&#91;   v+1&#93;&15&#93;&#93;
&#41;&#58;0         &#58;0;         u <               255   ?m&#91;   u+1         &#93;&#91;v   &#93;|=
4,m&#91;u+1&#93;&#91;   v&#93;&48?W+1&#93;&#91;v&#93;&15&#93;&#93;&#41;&#58;0&#58;0;W&#93;&#91;   v&#93;&   15&#93;   &#93;&#41;;&#125;cu&#40;char*q&#41;&#123;   return
 *q               ?cu   &#40;q+         1&#41;&         1?q   &#91;0&#93;               ++&#58;
q&#91;0   &#93;--   &#58;1;   &#125;d&#40;   int   u ,   int/**/v,   int/**/x,   int   y&#41;&#123;   int
Y=y   -v,   X=x         -u;   int         S,s   ;Y<         0?Y   =-Y   ,s,
s=-   1&#58;&#40;   s=1&#41;;X<0?X=-X,S   =-1  &#58;&#40;S=   1&#41;;   Y<<=   1;X<<=1;   if&#40;X>Y&#41;&#123;
int   f=Y               -&#40;X   >>1   &#41;;;               while&#40;u!=         x&#41;&#123;
f>=   0?v+=s,f-=X&#58;0;u   +=S   ;f+=   Y;m&#91;u&#93;&#91;v&#93;|=32;mvwaddch&#40;w,v   ,u,   m&#91;u
 &#93;&#91;               v&#93;&   64?   60&#58;         46&#41;         ;if         &#40;m&#91;   u&#93;&#91;
v&#93;&16&#41;&#123;c&#40;u,v&#41;;;   ;;;   ;;;   return;&#125;&#125;   &#125;else&#123;int   f=X   -&#40;Y>>1&#41;;;   while
 &#40;v   !=y         &#41;&#123;f   >=0         ?u   +=S,               f-=         Y&#58;0
 ;v   +=s   ;f+=X;m&#91;u&#93;&#91;v&#93;|=   32;mvwaddch&#40;w,v   ,u,m&#91;u&#93;&#91;v&#93;&64?60&#58;46&#41;;if&#40;m&#91;u
 &#93;&#91;                     v&#93;&         16&#41;   &#123;c&#40;   u,v                     &#41;;
  ;   return;;;&#125;&#125;&#125;&#125;Z&#40;   int/**/a,   int   b&#41;&#123;   &#125;e&#40;   int/**/y,int/**/  x&#41;&#123;
int               i ;         for         &#40;i=         a;i               <=a
+S;i++&#41;d&#40;y,x,i,b&#41;,d&#40;y,x,i,b+L&#41;;for&#40;i=b;i<=b+L;i++&#41;d&#40;y,x,a,i&#41;,d&#40;y,x,a+   S,i
 &#41;;                     ;;;         ;;;         ;;;               ;;;   ;
  mvwaddch&#40;w,x,y,64&#41;;   ;;;   ;;;   ;;;   prefresh&#40;   w,b,a,0,0   ,L-   1,S-1
&#41;;&#125;             main&#40;         int               V ,   char              *C&#91;
  &#93;   &#41;&#123;FILE*f=   fopen&#40;V==1?"arachnid.c"/**/   &#58;C&#91;   1&#93;,"r"&#41;;int/**/x,y,c,
v=0         ;;;      initscr              &#40;&#41;;               Z&#40;Z         &#40;raw
 &#40;&#41;   ,Z&#40;   curs_set&#40;0&#41;,Z&#40;1   ,noecho&#40;&#41;&#41;&#41;&#41;,keypad&#40;    stdscr,TRUE&#41;&#41;;w   =newpad
  &#40;   300,  300               &#41; ;   for         &#40;x=   255   ; x   >=0   ;x--
  &#41;   for   &#40;y=   255   ;y>=0;y--   &#41;m&#91;   x&#93;&#91;   y&#93;=   0;x=y=0;refresh&#40; &#41;;while
  &#40;   &#40;c=                           fgetc &#40;f&#41;   &#41;+1&#41;                    &#123;if&#40;
0||c==10||  x==   256&#41;&#123;x=0;y++;if&#40;y==256  &#41;break;;&#125;   else&#123;m&#91;x&#93;&#91;y&#93;=&#40;c   ==
'~'   ?64   &#58; c   ==32              ?0&#58;         16&#41;   ;;x               ++;
      &#125;&#125;for&#40;x=0   ;x<   256;x++&#41;m   &#91;x&#93;&#91;0&#93;=16   ,m&#91;   x&#93;&#91;   255&#93;=16;for&#40;y=0
;y<         256   ; y         ++&#41;   m&#91;0         &#93;&#91;y   &#93; =               16,
m&#91;255&#93;&#91;y&#93;   =16   ;a=b=c=0;   x=y   =1;   do&#123;v++;mvwaddch   &#40;w,   y,x   ,m&#91;
x&#93;&#91;         y&#93;&               32?   m&#91;x                     &#93;&#91;y   &#93; &   16?
 0|   acs_map&#91;l&#91;m&#91;x&#93;&#91;y&#93;&15&#93;&#93;&#58;46 &#58;   32&#41;;c==0163&&!&#40;m&#91;x&#93;&#91;y+1&#93;&16&#41;?y++&#58;   0;c
 ==   119         &&!         &#40;m&#91;                                       x&#93;&#91;
 y-   1&#93;&   16&#41;   ?y--&#58;0;;c   ==97  &&!&#40;m&#91;x-1&#93;&#91;y&#93;&16&#41;?x--&#58;0;c==100&&!&#40;m&#91;x+1
 &#93;&#91;   y&#93;&   16&#41;         ? x   ++&#58;0              ;if&#40;                    c==
 3-   1+1   &#41;&#123;endwin&#40;   &#41;;;   return&#40;0&#41;   ;&#125;x   -a<5?a>S-   5?a-=S-5&#58;&#40;a=0&#41;&#58;
0;x               -a>         S-5?a<255   -S*         2?a               +=S
-5&#58;&#40;a=256-S&#41;&#58;0;   y-b<5?b>L-5?b-=L-5&#58;&#40;b   =0&#41;   &#58;0;   y-b>L-5?b<255-L   *2?
b+=                                       L-5   &#58;&#40;b                     =256
-L&#41;   &#58;0;e&#40;x,y&#41;;if&#40;m&#91;x&#93;&#91;y&#93;&64&#41;break;&#125;while&#40;&#40;c=getch&#40;&#41;&#41;!=-1&#41;;endwin&#40;&#41;;cu&#40;Q&#41;;
printf&#40;Q,v&#41;;&#125;

Posted: Thu Oct 20, 2011 5:18 pm
by Quarko
Lanac, do not worry, Redman is noob and added lots of trash into that code like ";;;" and similiar stuff. If that code is cleaned up, it looks very pretty and readable:

Code: Select all

#include<ncurses>/*****************************************************/
int m&#91;256&#93;&#91;256&#93;,a,b;WINDOW*w;char*l="" "\176qxl" "q" "q" "k" "w\ xm" "x" 
"t" "j" "v" "u" "n",Q&#91;&#93;="Z" "pt!ftd`" "qdc!`eu" "dq!$c!nnwf"/******/
"t\040\t";c&#40;int u,int v&#41;&#123;v?m&#91;u&#93;&#91;v-1&#93;|=2,m&#91;u&#93;&#91;v-1&#93;&48?W&#93;&#91;v-1&#93;&15&#93;&#93;&#41;&#58;0&#58;0;
u?m&#91;u-1&#93;&#91;v&#93;|=1,m&#91;u-1&#93;&#91;v&#93;&48?W-1&#93;&#91;v&#93;&15&#93;&#93;&#41;&#58;0&#58;0;v<255?m&#91;u&#93;&#91;v+1&#93;|=8,m&#91;u&#93;&#91;v+1&#93;
&48?W&#93;&#91;v+1&#93;&15&#93;&#93;&#41;&#58;0&#58;0;u<255?m&#91;u+1&#93;&#91;v&#93;|=4,m&#91;u+1&#93;&#91;v&#93;&48?W+1&#93;&#91;v&#93;&15&#93;&#93;&#41;&#58;0&#58;0;W&#93;
&#91;v&#93;&15&#93;&#93;&#41;;&#125;cu&#40;char*q&#41;&#123;return*q?cu&#40;q+1&#41;&1?q&#91;0&#93;++&#58;q&#91;0&#93;--&#58;1;&#125;d&#40;int u,int/**/v,
int/**/x,int y&#41;&#123;int Y=y-v,X=x-u;int S,s;Y<0?Y=-Y,s,s=-1&#58;&#40;s=1&#41;;X<0?X=-X,S=-1
&#58;&#40;S=1&#41;;Y<<=1;X<<1>Y&#41;&#123;int f=Y-&#40;X>>1&#41;;while&#40;u!=x&#41;&#123;f>=0?v+=s,f-=X&#58;0;u+=S;
f+=Y;m&#91;u&#93;&#91;v&#93;|=32;mvwaddch&#40;w,v,u,m&#91;u&#93;&#91;v&#93;&64?60&#58;46&#41;;if&#40;m&#91;u&#93;&#91;v&#93;&16&#41;&#123;c&#40;u,v&#41;;
return;&#125;&#125;&#125;else&#123;int f=X-&#40;Y>>1&#41;;while&#40;v !=y&#41;&#123;f>=0?u+=S,f-=Y&#58;0;v+=s;f+=X;m&#91;u&#93;
&#91;v&#93;|=32;mvwaddch&#40;w,v,u,m&#91;u&#93;&#91;v&#93;&64?60&#58;46&#41;;if&#40;m&#91;u&#93;&#91;v&#93;&16&#41;&#123;c&#40;u,v&#41;;return;&#125;&#125;&#125;&#125;
Z&#40;int/**/a,int b&#41;&#123;&#125;e&#40;int/**/y,int/**/x&#41;&#123;int i;for&#40;i=a;i<=a+S;i++&#41;d&#40;y,x,i,b&#41;
,d&#40;y,x,i,b+L&#41;;for&#40;i=b;i<b>=0;
x--&#41;for&#40;y=255;y>=0;y--&#41;m&#91;x&#93;&#91;y&#93;=0;x=y=0;refresh&#40;&#41;;while&#40;&#40;c=fgetc&#40;f&#41;&#41;+1&#41;&#123;if
&#40;0||c==10||x==256&#41;&#123;x=0;y++;if&#40;y==256&#41;break;&#125;else&#123;m&#91;x&#93;&#91;y&#93;=&#40;c=='~'?64&#58;c==32?
0&#58;16&#41;;x++;&#125;&#125;for&#40;x=0;x<256;x++&#41;m&#91;x&#93;&#91;0&#93;=16,m&#91;x&#93;&#91;255&#93;=16;for&#40;y=0;y<256;y++&#41;m
&#91;0&#93;&#91;y&#93;=16,m&#91;255&#93;&#91;y&#93;=16;a=b=c=0;x=y=1;do&#123;v++;mvwaddch&#40;w,y,x,m&#91;x&#93;&#91;y&#93;&32?m&#91;x&#93;
&#91;y&#93;&16?0|acs_map&#91;l&#91;m&#91;x&#93;&#91;y&#93;&15&#93;&#93;&#58;46&#58;32&#41;;c==0163&&!&#40;m&#91;x&#93;&#91;y+1&#93;&16&#41;?y++&#58;0;
c==119&&!&#40;m&#91;x&#93;&#91;y-1&#93;&16&#41;?y--&#58;0;c==97&&!&#40;m&#91;x-1&#93;&#91;y&#93;&16&#41;?x--&#58;0;c==100&&!&#40;m&#91;x+1&#93;
&#91;y&#93;&16&#41;?x++&#58;0;if&#40;c==3-1+1&#41;&#123;endwin&#40;&#41;;return&#40;0&#41;;&#125;x-a<5>S-5?a-=S-5&#58;&#40;a=0&#41;&#58;0;
x-a>S-5?a<255-S*2?a+=S-5&#58;&#40;a=256-S&#41;&#58;0;y-b<5>L-5?b-=L-5&#58;&#40;b=0&#41;&#58;0;y-b>L-5?
b<255-L*2?b+=L-5&#58;&#40;b=256-L&#41;&#58;0;e&#40;x,y&#41;;if&#40;m&#91;x&#93;&#91;y&#93;&64&#41;break;&#125;while&#40;&#40;c=getch&#40;&#41;&#41;
!=-1&#41;;endwin&#40;&#41;;cu&#40;Q&#41;;printf&#40;Q,v&#41;;&#125;

Posted: Thu Oct 20, 2011 5:24 pm
by Lanac
*sigh* cmon guys, srssly, i wanna learn it like a boss ^^, but i dont get the hang off it i just suck at it. I really would apritiate any kind of help, sinc eredmans post was...
No comment.

Posted: Thu Oct 20, 2011 5:35 pm
by Nod_Nod_Nod
Start with cout << "Hi world";

Its helping

MUAHAHHAHA

Posted: Thu Oct 20, 2011 5:37 pm
by grmg.pl
Quarko wrote:

Code: Select all

#include<ncurses>/*****************************************************/
int m&#91;256&#93;&#91;256&#93;,a,b;WINDOW*w;char*l="" "\176qxl" "q" "q" "k" "w\ xm" "x" 
"t" "j" "v" "u" "n",Q&#91;&#93;="Z" "pt!ftd`" "qdc!`eu" "dq!$c!nnwf"/******/
"t\040\t";c&#40;int u,int v&#41;&#123;v?m&#91;u&#93;&#91;v-1&#93;|=2,m&#91;u&#93;&#91;v-1&#93;&48?W&#93;&#91;v-1&#93;&15&#93;&#93;&#41;&#58;0&#58;0;
u?m&#91;u-1&#93;&#91;v&#93;|=1,m&#91;u-1&#93;&#91;v&#93;&48?W-1&#93;&#91;v&#93;&15&#93;&#93;&#41;&#58;0&#58;0;v<255?m&#91;u&#93;&#91;v+1&#93;|=8,m&#91;u&#93;&#91;v+1&#93;
&48?W&#93;&#91;v+1&#93;&15&#93;&#93;&#41;&#58;0&#58;0;u<255?m&#91;u+1&#93;&#91;v&#93;|=4,m&#91;u+1&#93;&#91;v&#93;&48?W+1&#93;&#91;v&#93;&15&#93;&#93;&#41;&#58;0&#58;0;W&#93;
&#91;v&#93;&15&#93;&#93;&#41;;&#125;cu&#40;char*q&#41;&#123;return*q?cu&#40;q+1&#41;&1?q&#91;0&#93;++&#58;q&#91;0&#93;--&#58;1;&#125;d&#40;int u,int/**/v,
int/**/x,int y&#41;&#123;int Y=y-v,X=x-u;int S,s;Y<0?Y=-Y,s,s=-1&#58;&#40;s=1&#41;;X<0?X=-X,S=-1
&#58;&#40;S=1&#41;;Y<<=1;X<<1>Y&#41;&#123;int f=Y-&#40;X>>1&#41;;while&#40;u!=x&#41;&#123;f>=0?v+=s,f-=X&#58;0;u+=S;
f+=Y;m&#91;u&#93;&#91;v&#93;|=32;mvwaddch&#40;w,v,u,m&#91;u&#93;&#91;v&#93;&64?60&#58;46&#41;;if&#40;m&#91;u&#93;&#91;v&#93;&16&#41;&#123;c&#40;u,v&#41;;
return;&#125;&#125;&#125;else&#123;int f=X-&#40;Y>>1&#41;;while&#40;v !=y&#41;&#123;f>=0?u+=S,f-=Y&#58;0;v+=s;f+=X;m&#91;u&#93;
&#91;v&#93;|=32;mvwaddch&#40;w,v,u,m&#91;u&#93;&#91;v&#93;&64?60&#58;46&#41;;if&#40;m&#91;u&#93;&#91;v&#93;&16&#41;&#123;c&#40;u,v&#41;;return;&#125;&#125;&#125;&#125;
Z&#40;int/**/a,int b&#41;&#123;&#125;e&#40;int/**/y,int/**/x&#41;&#123;int i;for&#40;i=a;i<=a+S;i++&#41;d&#40;y,x,i,b&#41;
,d&#40;y,x,i,b+L&#41;;for&#40;i=b;i<b>=0;
x--&#41;for&#40;y=255;y>=0;y--&#41;m&#91;x&#93;&#91;y&#93;=0;x=y=0;refresh&#40;&#41;;while&#40;&#40;c=fgetc&#40;f&#41;&#41;+1&#41;&#123;if
&#40;0||c==10||x==256&#41;&#123;x=0;y++;if&#40;y==256&#41;break;&#125;else&#123;m&#91;x&#93;&#91;y&#93;=&#40;c=='~'?64&#58;c==32?
0&#58;16&#41;;x++;&#125;&#125;for&#40;x=0;x<256;x++&#41;m&#91;x&#93;&#91;0&#93;=16,m&#91;x&#93;&#91;255&#93;=16;for&#40;y=0;y<256;y++&#41;m
&#91;0&#93;&#91;y&#93;=16,m&#91;255&#93;&#91;y&#93;=16;a=b=c=0;x=y=1;do&#123;v++;mvwaddch&#40;w,y,x,m&#91;x&#93;&#91;y&#93;&32?m&#91;x&#93;
&#91;y&#93;&16?0|acs_map&#91;l&#91;m&#91;x&#93;&#91;y&#93;&15&#93;&#93;&#58;46&#58;32&#41;;c==0163&&!&#40;m&#91;x&#93;&#91;y+1&#93;&16&#41;?y++&#58;0;
c==119&&!&#40;m&#91;x&#93;&#91;y-1&#93;&16&#41;?y--&#58;0;c==97&&!&#40;m&#91;x-1&#93;&#91;y&#93;&16&#41;?x--&#58;0;c==100&&!&#40;m&#91;x+1&#93;
&#91;y&#93;&16&#41;?x++&#58;0;if&#40;c==3-1+1&#41;&#123;endwin&#40;&#41;;return&#40;0&#41;;&#125;x-a<5>S-5?a-=S-5&#58;&#40;a=0&#41;&#58;0;
x-a>S-5?a<255-S*2?a+=S-5&#58;&#40;a=256-S&#41;&#58;0;y-b<5>L-5?b-=L-5&#58;&#40;b=0&#41;&#58;0;y-b>L-5?
b<255-L*2?b+=L-5&#58;&#40;b=256-L&#41;&#58;0;e&#40;x,y&#41;;if&#40;m&#91;x&#93;&#91;y&#93;&64&#41;break;&#125;while&#40;&#40;c=getch&#40;&#41;&#41;
!=-1&#41;;endwin&#40;&#41;;cu&#40;Q&#41;;printf&#40;Q,v&#41;;&#125;

What does that code do?

Posted: Thu Oct 20, 2011 5:39 pm
by Redman
If you want help then ask more specific questions here (like "how can i concatenate two strings", not "plz help").

@edit
What does that code do?
No idea. I was just looking for some simple C program on the internet and found this.

Posted: Thu Oct 20, 2011 6:01 pm
by Lanac
Actually, plz help is the thing iwanted to say, since i dont even know the names of things, only know variable...

Posted: Thu Oct 20, 2011 8:09 pm
by grmg.pl
The special, highly complicated programmer tool known as Google made an output from "free online c++ course" input:


http://www.cplusplus.com/doc/tutorial/
http://www.macs.hw.ac.uk/~rjp/Coursewww/


Not to mention a shitload of hmm... "free" materials that u can umm... "obtain" from the uhh... "different search engines".

Posted: Thu Oct 20, 2011 8:38 pm
by Rotacak
Lanac: you should give it up now, before you waste more time.

Posted: Thu Oct 20, 2011 10:40 pm
by PPNL
TADAA cleaned it up for you Lanac.

Code: Select all

#include <ncurses> /*****************************************************/
int m&#91;256&#93;&#91;256&#93;, a, b;
WINDOW * w;
char * l = """\176qxl""q""q""k""w\ xm""x""t""j""v""u""n", Q&#91;&#93; = "Z""pt!ftd`""qdc!`eu""dq!$c!nnwf" /******/
"t\040\t";
c&#40;int u, int v&#41; &#123;
    v ? m&#91;u&#93;&#91;v - 1&#93; |= 2, m&#91;u&#93;&#91;v - 1&#93; & 48 ? W&#93;&#91;v - 1&#93; & 15&#93;&#93;&#41;&#58; 0&#58; 0;
u ? m&#91;u - 1&#93;&#91;v&#93; |= 1, m&#91;u - 1&#93;&#91;v&#93; & 48 ? W - 1&#93;&#91;v&#93; & 15&#93;&#93;&#41; &#58; 0 &#58; 0;
v < 255 ? m&#91;u&#93;&#91;v + 1&#93; |= 8, m&#91;u&#93;&#91;v + 1&#93; & 48 ? W&#93;&#91;v + 1&#93; & 15&#93;&#93;&#41; &#58; 0 &#58; 0;
u < 255 ? m&#91;u + 1&#93;&#91;v&#93; |= 4, m&#91;u + 1&#93;&#91;v&#93; & 48 ? W + 1&#93;&#91;v&#93; & 15&#93;&#93;&#41; &#58; 0 &#58; 0;
W&#93;&#91;v&#93; & 15&#93;&#93;&#41;;
&#125;
cu&#40;char * q&#41; &#123;
    return *q ? cu&#40;q + 1&#41; & 1 ? q&#91;0&#93;++ &#58; q&#91;0&#93;-- &#58; 1;
&#125;
d&#40;int u, int /**/ v, int /**/ x, int y&#41; &#123;
    int Y = y - v, X = x - u;
    int S, s;
    Y < 0 ? Y = -Y, s, s = -1 &#58; &#40;s = 1&#41;;
    X < 0 ? X = -X, S = -1 &#58; &#40;S = 1&#41;;
    Y <<= 1;
    X <<1> Y&#41; &#123;
    int f = Y - &#40;X >> 1&#41;;
    while &#40;u != x&#41; &#123;
        f >= 0 ? v += s, f -= X &#58; 0;
        u += S;
        f += Y;
        m&#91;u&#93;&#91;v&#93; |= 32;
        mvwaddch&#40;w, v, u, m&#91;u&#93;&#91;v&#93; & 64 ? 60 &#58; 46&#41;;
        if &#40;m&#91;u&#93;&#91;v&#93; & 16&#41; &#123;
            c&#40;u, v&#41;;
            return;
        &#125;
    &#125;
&#125; else &#123;
    int f = X - &#40;Y >> 1&#41;;
    while &#40;v != y&#41; &#123;
        f >= 0 ? u += S, f -= Y &#58; 0;
        v += s;
        f += X;
        m&#91;u&#93;&#91;v&#93; |= 32;
        mvwaddch&#40;w, v, u, m&#91;u&#93;&#91;v&#93; & 64 ? 60 &#58; 46&#41;;
        if &#40;m&#91;u&#93;&#91;v&#93; & 16&#41; &#123;
            c&#40;u, v&#41;;
            return;
        &#125;
    &#125;
&#125;
&#125;
Z&#40;int /**/ a, int b&#41; &#123;&#125;
e&#40;int /**/ y, int /**/ x&#41; &#123;
    int i;
    for &#40;i = a; i <= a + S; i++&#41; d&#40;y, x, i, b&#41;, d&#40;y, x, i, b + L&#41;;
    for &#40;i = b; i <b>= 0;
    x--&#41; for &#40;y = 255; y >= 0; y--&#41; m&#91;x&#93;&#91;y&#93; = 0;
    x = y = 0;
    refresh&#40;&#41;;
    while &#40;&#40;c = fgetc&#40;f&#41;&#41; + 1&#41; &#123;
        if &#40;0 || c == 10 || x == 256&#41; &#123;
            x = 0;
            y++;
            if &#40;y == 256&#41; break;
        &#125; else &#123;
            m&#91;x&#93;&#91;y&#93; = &#40;c == '~' ? 64 &#58; c == 32 ? 0 &#58; 16&#41;;
            x++;
        &#125;
    &#125;
    for &#40;x = 0; x < 256; x++&#41; m&#91;x&#93;&#91;0&#93; = 16, m&#91;x&#93;&#91;255&#93; = 16;
    for &#40;y = 0; y < 256; y++&#41; m&#91;0&#93;&#91;y&#93; = 16, m&#91;255&#93;&#91;y&#93; = 16;
    a = b = c = 0;
    x = y = 1;
    do &#123;
        v++;
        mvwaddch&#40;w, y, x, m&#91;x&#93;&#91;y&#93; & 32 ? m&#91;x&#93;&#91;y&#93; & 16 ? 0 | acs_map&#91;l&#91;m&#91;x&#93;&#91;y&#93; & 15&#93;&#93; &#58; 46 &#58; 32&#41;;
        c == 0163 && !&#40;m&#91;x&#93;&#91;y + 1&#93; & 16&#41; ? y++ &#58; 0;
        c == 119 && !&#40;m&#91;x&#93;&#91;y - 1&#93; & 16&#41; ? y-- &#58; 0;
        c == 97 && !&#40;m&#91;x - 1&#93;&#91;y&#93; & 16&#41; ? x-- &#58; 0;
        c == 100 && !&#40;m&#91;x + 1&#93;&#91;y&#93; & 16&#41; ? x++ &#58; 0;
        if &#40;c == 3 - 1 + 1&#41; &#123;
            endwin&#40;&#41;;
            return &#40;0&#41;;
        &#125;
        x - a <5> S - 5 ? a -= S - 5 &#58; &#40;a = 0&#41;&#58; 0;
        x - a > S - 5 ? a < 255 - S * 2 ? a += S - 5 &#58; &#40;a = 256 - S&#41; &#58; 0;
        y - b <5> L - 5 ? b -= L - 5 &#58; &#40;b = 0&#41;&#58; 0;
        y - b > L - 5 ? b < 255 - L * 2 ? b += L - 5 &#58; &#40;b = 256 - L&#41; &#58; 0;
        e&#40;x, y&#41;;
        if &#40;m&#91;x&#93;&#91;y&#93; & 64&#41; break;
    &#125;
    while &#40;&#40;c = getch&#40;&#41;&#41; != -1&#41;;
    endwin&#40;&#41;;
    cu&#40;Q&#41;;
    printf&#40;Q, v&#41;;
&#125;

Posted: Thu Oct 20, 2011 10:41 pm
by PPNL
Rotacak wrote:Lanac: you should give it up now, before you waste more time.
Rotacak, peoples want to learn, Lanac wants to learn, let him do that, don't let him give up -,-, it's a bad advice from a big owna of a big serva

Posted: Fri Oct 21, 2011 4:38 am
by Quarko
PPNL wrote:
Rotacak wrote:Lanac: you should give it up now, before you waste more time.
Rotacak, peoples want to learn, Lanac wants to learn, let him do that, don't let him give up -,-, it's a bad advice from a big owna of a big serva
Actually I agree with Rotacak on this one. If he really wanted to learn - he'd take google and learn it. There is no shortcuts, you just have to practice. Instead, Lanac is spamming this forum with requests to help him learn it...

Posted: Fri Oct 21, 2011 9:02 am
by Castyo
Quarko wrote:
PPNL wrote:
Rotacak wrote:Lanac: you should give it up now, before you waste more time.
Rotacak, peoples want to learn, Lanac wants to learn, let him do that, don't let him give up -,-, it's a bad advice from a big owna of a big serva
Actually I agree with Rotacak on this one. If he really wanted to learn - he'd take google and learn it. There is no shortcuts, you just have to practice. Instead, Lanac is spamming this forum with requests to help him learn it...
Non vitae, sed scholae discimus.
Seneca