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

Post anything else

Moderator: Nod_Nod_Nod

Message
Author
User avatar
Lanac
Tyrant
Tyrant
Posts: 865
Joined: Fri Sep 10, 2010 4:18 pm
Location: Idk...

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

#1 Post by Lanac » Thu Oct 20, 2011 2:48 pm

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?
My Youtube Channel:
Please help my ass and click on link, im a poor bitch...(+ ill make some trem videos too :D)
http://adf.ly/2qaKp

User avatar
pmd
Server supporter
Server supporter
Posts: 268
Joined: Sun May 16, 2010 8:10 pm
Location: Novorossiysk city, Russian Federation

#2 Post by pmd » Thu Oct 20, 2011 4:28 pm

c++ are sophisticated. especially pure. the acrobatics with strings are so epic.
Quarko wrote: If you have time to think about crap - you are not working hard enough.

User avatar
Redman
Marauder
Marauder
Posts: 403
Joined: Fri Apr 03, 2009 6:00 pm
Location: Walbrzych, Poland

#3 Post by Redman » Thu Oct 20, 2011 4:54 pm

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;

User avatar
Quarko
Server supporter
Server supporter
Posts: 1227
Joined: Fri May 22, 2009 9:03 pm
Location: Kaunas, Lithuania

#4 Post by Quarko » Thu Oct 20, 2011 5:18 pm

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;

User avatar
Lanac
Tyrant
Tyrant
Posts: 865
Joined: Fri Sep 10, 2010 4:18 pm
Location: Idk...

#5 Post by Lanac » Thu Oct 20, 2011 5:24 pm

*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.
My Youtube Channel:
Please help my ass and click on link, im a poor bitch...(+ ill make some trem videos too :D)
http://adf.ly/2qaKp

User avatar
Nod_Nod_Nod
Tyrant
Tyrant
Posts: 1079
Joined: Sun Mar 14, 2010 6:58 pm
Location: Poland
Contact:

#6 Post by Nod_Nod_Nod » Thu Oct 20, 2011 5:35 pm

Start with cout << "Hi world";

Its helping

MUAHAHHAHA
The nodding of the head once to symbolize a greeting, cuz we white folk to damn lazy to open our mouths and speak up. Nods are also easier to shake off than a flase "hello".
"Person nods at you", or your direction, "you nod back"

grmg.pl
Marauder
Marauder
Posts: 514
Joined: Sun Feb 06, 2011 1:00 am

#7 Post by grmg.pl » Thu Oct 20, 2011 5:37 pm

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?

User avatar
Redman
Marauder
Marauder
Posts: 403
Joined: Fri Apr 03, 2009 6:00 pm
Location: Walbrzych, Poland

#8 Post by Redman » Thu Oct 20, 2011 5:39 pm

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.

User avatar
Lanac
Tyrant
Tyrant
Posts: 865
Joined: Fri Sep 10, 2010 4:18 pm
Location: Idk...

#9 Post by Lanac » Thu Oct 20, 2011 6:01 pm

Actually, plz help is the thing iwanted to say, since i dont even know the names of things, only know variable...
My Youtube Channel:
Please help my ass and click on link, im a poor bitch...(+ ill make some trem videos too :D)
http://adf.ly/2qaKp

grmg.pl
Marauder
Marauder
Posts: 514
Joined: Sun Feb 06, 2011 1:00 am

#10 Post by grmg.pl » Thu Oct 20, 2011 8:09 pm

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".

User avatar
Rotacak
Tyrant
Tyrant
Posts: 1387
Joined: Mon Sep 17, 2007 2:07 pm
Location: Czech Republic

#11 Post by Rotacak » Thu Oct 20, 2011 8:38 pm

Lanac: you should give it up now, before you waste more time.

User avatar
PPNL
Server supporter
Server supporter
Posts: 625
Joined: Sun May 02, 2010 10:38 am
Location: The Netherlands

#12 Post by PPNL » Thu Oct 20, 2011 10:40 pm

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;
I Maul Ya
McDretch
McRauder
*PPNL MAULED **
*PPNL ZaPP ZaPP
Sky Mauler
O_o

User avatar
PPNL
Server supporter
Server supporter
Posts: 625
Joined: Sun May 02, 2010 10:38 am
Location: The Netherlands

#13 Post by PPNL » Thu Oct 20, 2011 10:41 pm

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
I Maul Ya
McDretch
McRauder
*PPNL MAULED **
*PPNL ZaPP ZaPP
Sky Mauler
O_o

User avatar
Quarko
Server supporter
Server supporter
Posts: 1227
Joined: Fri May 22, 2009 9:03 pm
Location: Kaunas, Lithuania

#14 Post by Quarko » Fri Oct 21, 2011 4:38 am

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...

User avatar
Castyo
Dretch
Dretch
Posts: 98
Joined: Thu Sep 27, 2007 7:08 pm
Location: Italy
Contact:

#15 Post by Castyo » Fri Oct 21, 2011 9:02 am

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

Post Reply