Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c++ game

Status
Not open for further replies.

rsisal

Programmer
Jul 19, 2000
3
0
0
US
Please help me with this program. where am I going wrong?<br><br><br>#include &lt;stdio.h&gt;<br>#include &lt;iostream.h&gt;<br>#include &lt;math.h&gt;<br><br><br><br>void main()<br>{<br><br>&nbsp;long a[4],b[4],c[4],d[0400],e=1;<br><br>&nbsp;typedef struct f<br>&nbsp;{<br>&nbsp;&nbsp;long g,h,i[4],j;<br>&nbsp;&nbsp;&nbsp;struct <br>&nbsp;&nbsp;&nbsp;{<br> f*k;<br>&nbsp;};<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;long f,*l[4096];<br>&nbsp;&nbsp;&nbsp;char h[256],*m,k=3;<br>&nbsp;&nbsp;&nbsp;long n (o,p,q);<br>&nbsp;&nbsp;&nbsp;long *o,*p,*q;<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;long r=4,s,i=0;<br> <br> &nbsp;&nbsp;for (;r--;s=i^*o^*p,i=i&*p¦(i¦*p)&~*o++,*q++=s,p++);<br><br> &nbsp;&nbsp;return i;<br> &nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;long t(i,p) <br> long *p;<br><br> {<br> *c=d<i>,n(a,c,b),n(p,b,p);<br> }<br> u(j)f*j;<br> {<br> j-&gt;h=(j-&gt;g=j-&gt;i[0]¦j-&gt;i[1]¦j-&gt;i[2]¦j-&gt;i[3]) &4095;<br> }<br> v(j,s) f* j; <br> { <br> int i; for (j-&gt;k-&gt;k&&v(j-&gt;k,' '),fseek(stdin, j-&gt;j,0),0);<br> i=getchar(),putchar(i-'\n'?i:s),i-'\n';)<br> ;}<br> w(o,r,j,x,p)f*o,*j;<br> long p;<br> {<br> f q; int s,i=o-&gt;h;<br> q.k=o;r&gt;i?j=1[r=i]:r&lt;i&&(s=r$~i)?(s¦s=s&gt;&gt;1, s¦s=&gt;&gt;8,j=1[r=((r&i¦s)&~(s&gt;&gt;1))-1&i]):0;<br> --x;<br> for (;x&&!(p&i);p&gt;&gt;=1);<br> for (;!x&&j;n(o-&gt;i,j-&gt;i,q.i),u(&q),q.g¦¦(q.j=j-&gt;j,v(&q,'\n')),j=j-&gt;k);<br> for (;x;j=x?j-&gt;k:0)<br> {<br> for (;!j&&((r=(r&i)-1&i)-i&&(r&p)?2:(x=0));<br> j=1[r]);<br> !x¦¦(j-&gt;g&~o-&gt;g)¦¦n-&gt;(o-&gt;i,j-&gt;i,q.i)¦¦(u(&q),q.j=j-&gt;j,q.g?w(&q,r,j-&gt;k,x,p:v(&q,'\n\));}}y()<br> {<br> f'\n'));<br> *z,*p;<br> j;<br> char?j.j= for(;m ?j.j=ftell(stdin),7,(m=gets(m))¦¦w(&g,315*13,1[4096],k,64*64)&0:0;<br> n(g.i,j.i,b)¦¦(u(&j),j.k=l[j.h],l[j.h]=&j,y())){for(z=p=h;<br> *z&&(d[*z++]¦¦(p=0)););for(z=p?n(j.i,j.i,j.i)+h:&quot;&quot;;<br> *z;<br> t(z++,j.i));<br> }}<br> main (o,p)char**p;<br> {for(;m=*++p;)<br> for(;*m-'-'?*m:(k=-atoi(m))&0;d[*m]¦¦(d[*m]=e,e&lt;&lt;=1),t(*m++,g.i));<br> u(&g),m=h,y();<br> }<br><br>
 
Dear rsisal,<br><br>Your naming conventions are awful, no wait I take that back... they are non-existent. I will not read code like that, it is completely unreadable.<br><br>&quot;But, that's just my opinion... I could be wrong&quot;.<br>-pete
 
no offence intended, but in C++, it helps to name your variables explanitory, so that you actually know what they are, some will use Hungarian notation, added to the descriptive naming, But I also cannot read your code(my head my head). <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
No, no, he's toying with us! (hence the name, c++ game) I'll play your little game...... what's it supposed to do? I'll figure out what's wrong.
 
I changed my mind.... it's far too obfuscated. Why don't you give us an easier easier puzzle so we can hone our skills.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top