.hack//GU
Apr 3 2007, 11:56 AM
| | Please help me, I have an assignment to make a tetris-like game in C/C++. Anyone could help me with the source code?
I've thought the algorithm to make a 2-D matrix, but in the end all I can make is only the one I've attached.
So, please anyone who knows how to make this one to help me. Thank you in advance. 
(Attachment: Tetris2.TXT should be Tetris2.CPP to edit in C++) |
Reply
osknockout
Apr 4 2007, 12:03 AM
Woah. I couldn't even compile that one. (Probably because I don't have the identical headers to yours, I'm sure I even have a copy of dos.h) Mind commenting through the file? I mean, I'm probably one of the last people who should say this, but it's really necessary sometimes. Especially when you're talking to a public who has no clue what useX is used for or why it equals 41 instead of 42 So yeah, please comment through it. Otherwise it'd take us a lot longer than it should to find a problem and you'd get less people to help you.
Reply
.hack//GU
Apr 4 2007, 11:21 AM
QUOTE(osknockout @ Apr 4 2007, 12:03 AM)  Woah. I couldn't even compile that one. (Probably because I don't have the identical headers to yours, I'm sure I even have a copy of dos.h) Mind commenting through the file? I mean, I'm probably one of the last people who should say this, but it's really necessary sometimes. Especially when you're talking to a public who has no clue what useX is used for or why it equals 41 instead of 42 So yeah, please comment through it. Otherwise it'd take us a lot longer than it should to find a problem and you'd get less people to help you. Well, I thought my code itself is a failure. I'll take another glimpse through the codes tonight. Anyway, I've acquired some tetris code but all of it are in graphics.h. Anyone know where I can get tetris code without graphics.h?
Reply
galexcd
Apr 11 2007, 12:10 AM
I made a tetris game! It was part of a spoof i made of DOS in c++ feel free to use my source if you can find the tetris sourcecode inside the OS. I looked through the file and found some lines of code that start with //START PONG and // END PONG so i think all the code is there. This should be all of it: CODE //START PONG void linecall(int line,int computerlocal,int plrlocal,int ballx,int bally) { int loopvar; if(computerlocal+3>=line&&computerlocal<=line) { cout << "|"; }else{ cout << " "; } if(bally==line) { loopvar=1; while(loopvar<ballx) { cout << " "; loopvar++; } cout << "O"; while(loopvar<40) { cout << " "; loopvar++; } }else{ cout << " "; } if(plrlocal+3>=line&&plrlocal<=line) { cout << "|"; } cout << "\n"; } void playpong(int diff) { system("cls"); //10 rows //paddles 4 //40 cols //dwnleft-1 //dwnright-2 //upleft-3 //upright-4 int computerlocal=1; int plrlocal=1; int ballx=20; int bally=5; int balldir=1; int gamerun=1; int loopvar;
while(gamerun==1) { //linecall loopvar=1; while(loopvar<=10) { linecall(loopvar,computerlocal,plrlocal,ballx,bally); loopvar++; } if(ballx>=41||ballx<=0) { if(ballx>=41) { gamerun=0; cout << "You Lost!\n"; }else{ gamerun=0; cout << "You Won!\n"; } }else{ //computer ai if((balldir==1)||(balldir==3)) { if(((rand()%diff)*20)>(rand()%50)) { if(computerlocal+2<bally) { computerlocal++; } if(computerlocal+2>bally) { computerlocal--; } } } if(computerlocal<1) { computerlocal=1; } if(computerlocal>7) { computerlocal=7; } //move ball if(ballx==40&&plrlocal+3>=bally&&plrlocal<=bally) { if(balldir==2) { balldir=1; } if(balldir==4) { balldir=3; } } if(ballx==1&&computerlocal+3>=bally&&computerlocal<=bally) { if(balldir==3) { balldir=4; } if(balldir==1) { balldir=2; } } if(bally==0) { if(balldir==3) { balldir=1; } if(balldir==4) { balldir=2; } } if(bally==10) { if(balldir==1) { balldir=3; } if(balldir==2) { balldir=4; } } if(balldir==1) { bally++; ballx--; } if(balldir==2) { bally++; ballx++; } if(balldir==3) { bally--; ballx--; } if(balldir==4) { bally--; ballx++; } clock_t endwait; endwait = clock () + .02 * CLK_TCK; while (clock() < endwait) {} //key listen int ch; if(kbhit()) { ch = getch(); if ( ch == 0 || ch == 224 ) { ch = 256 + getch(); } if(ch==328) { plrlocal--; } if(ch==336) { plrlocal++; } if(ch==27) { system("cls"); cout << "Pong game ended.\n"; gamerun=0; } if(gamerun==1) { system("cls"); } }else{ clock_t endwait; endwait = clock () + .02 * CLK_TCK; while (clock() < endwait) {} system("cls"); } if(plrlocal<1) { plrlocal=1; } if(plrlocal>7) { plrlocal=7; } } } } //END PONG But this code might need the rest of the program to work.. I don't know, its been ages since ive looked at it. Good luck
Reply
galexcd
Apr 11 2007, 05:13 AM
Um... My bad... I totaly confused tetris with pong there for a second... Wow... Sorry. Well if you want the code for a pong game, there it is... hehe
Reply
Blessed
Apr 11 2007, 11:22 AM
what C++ compyler / program are you guŭ using i whant to learn how to make some litle app and stuff. can you guy's give me some links 
Reply
bin1011111
Apr 24 2007, 02:16 AM
if ur using windows i'd go with http://www.bloodshed.net/devcpp.html, ive been using it for years and have no complaints
Reply
Recent Queries:--
tetris source code - 46.20 hr back. (3)
-
"php tetris", "source code", "free" - 156.87 hr back. (1)
-
tetris game code - 162.92 hr back. (1)
-
tetris code - 198.07 hr back. (1)
-
tetris game source code in c - 288.56 hr back. (1)
-
tetris source code visual c - 288.80 hr back. (1)
-
tetris c code - 292.64 hr back. (1)
-
tetris open source - 320.47 hr back. (1)
-
tetris c code - 546.45 hr back. (1)
-
c tetris game - 698.04 hr back. (1)
-
tetris c - 757.40 hr back. (1)
-
tetris source code on c - 776.64 hr back. (1)
-
tetris program c - 802.98 hr back. (1)
-
how to make tetris source code - 908.41 hr back. (1)
Similar Topics
Keywords : tetris, sourcode, making, tetris, c, c,
- My Modern History Speech- Is It Good? Am I Making Any Historical Inaccuracies?
(2)
Browser Compatibility Problem With Firefox - Javascript + Css
Having trouble making a script work right - any suggestions? (3) Hi, Im working on a website, and im trying to make a right-click menu, which opens on right click,
wherever the cursor is, and closes on mouse out. I wrote the code below, and when i ran it in IE it
ran fine, just how i wanted it to work. However in firefox, the menu just opened in the top left. im
presuming this is because it doesnt like my style changing in the javascript. Any ideas, and
suggestions? If i cant make this work, i will just make it so it works slightly differently when
viewev in firefox so that it can just open in one place. All ideas appreciated. ....
Making Realistic Clouds
Photo Shops Realistic Cloud TUT! (0) Well First off this is just a simple Tutorial on how to make a Realistic Clouds Background First
off you'll need Adobe Photo Shop, After getting that you'll need a Brain, a pair of hands,
and a few Basic Photo Shop Skills! I Created this when I first Started using Photo Shop So this
shouldn't be an issue. okay First step : Open a new RGB Background with Transparency. CODE
File -> New Make the Settings look like this Name : Clouds Preset : Custom Size :
Width : 500 | Pixels Height : 500 | Pixels Resolution : 72.009 | Pixels/Inch Color ....
Help Needed: Rewritting Uris From .htaccess
Making ugly dinamyc URIs look nicer (0) I think this should be easy for someone experienced, but I have never done something similar, so I
need a bit of guidance. I have a mini-site under a subdomain that entirelly relies on dynamic URIs.
All pages have URIs in the form http://towo.dragon-tech.org/index.php?lang...mp;section=news
http://towo.dragon-tech.org/index.php?lang...mp;section=home and so on. The index.php script takes
care of retrieving the appropriate content from both the database and some include files, and
everything is working fine. Only that these URIs look quite ugly on any visitor's....
[ask] Making Video When We Use An Application In Our Computer?
asking the best software to make this.. (5) i have a question, would somebody tell me the software (if there any) of making video when we use
some applications in our computer, it's like a tutorial video, if you answer it using the video
camera it was a bad job, but i think it uses a software/an application which records our activity
when we use our computer.. hmmm.. sorry guys if i seem so idiot, but i need an answer... thanks
before.....
Making A Picture Viewer Website
Html programming or javascript (3) this is one thing i've struggled with for ages. I want a webpage where there are little
thumbnails and in the middle somewhere is the main picture. The littole thumbnails or snipets of
infor when clicked display the main image corresponding to that clicked thumbnail or link. e.g
pictures of the country side listed in pairs or 3's or 4's in a column and you click each
one an the main view on the screen displays that particular picture. How is this achieved. Can any
one gimme a link to a site with templated for that or javascript for that or html code or past....
Open Program Copyrights For Third World Nations
By making software free many can become employed (7) I propose the idea that giving free premium software to those who could never afford a purchase can
only help the owners of that software. Some say that if a sale was never going to happen it
can't be a lost sale. I agree. If people can get started learning to use programs they could
never buy, they may develop skills and abilities that would enable future revenue and loyalty. At
the same, time a third world nation can have more development as skilled and trained professionals
grow. Another important issue would be addressed as well. Piracy. By lifting the copyrig....
Making A Screenshot
A tutorial on how to make a screenshot with MS (3) Specs Hardness: 1 Time: about 2 minutes Needings: -A (small) brain -A keyboard -MS Paint
Steps: 1. Press the Print Screen button on your keyboard. 2. Open Microsoft Paint. 3. Paste
(CTRL+V). 4. Save/Edit the image. (I prefer saving as .png or .tif) ét voila, you've just got
yourself a picture /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif"
/>....
Making A Simple Signature With Adobe Photoshop
A tutorial to basic signature designing: By Accure (3) Specs Hardness: 4 / 10 Time: about 10 minutes Result: My .PSD File: Download it now!
Needings: -Basic Photoshop knowlegend. -Adobe Photoshop CS2 (Or CS3/CS4) -Brushes set ( available
here ) -A render ( available here ) Basic knowlegend: Steps: 01. Open Adobe Photoshop,
and go File > New. 02. select the sizes Width: 350 pixels . Height: 150 pixels . Press OK .
03. Press the button to maximize the window of your new project. 04. Fill your background with
black (by using the "fill" function). 05. Press F5, click on the small arrow a....
Making My Own Browser
Uhm...need a name (10) I am currently developing my own Web Browser and I need a name for it /biggrin.gif"
style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> So if you got any good
ideas please do post them /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0"
alt="biggrin.gif" />....
Recommended List Of Money Making Sites
A list of 10 sites from which easy money can be made (0) I just want to let everyone know I have updated my list of money making websites and in my opinion
the 10 listed are the most reliable and honest money making sites that are free to join available.
Please review this blog and let me know what you think http://makeeasymoney247.blogspot.com ....
Please Can You Review My Blog
List of recommended sites for making money online (3) I am currently in the process of constructing a list of the best sites through which to make money
online and would like people to take a look at the sites I have added so far. I am obviously still a
long way of completing it but just wondering whether people think it is a good site / idea
http://makeeasymoney247.blogspot.com Also if you have not yet signed up to ClixSense I would
highly recommend it. You can join for free but you are better of paying the small $10 yearly
membership fee as this will bring you a ton more paid adverts - more than any other site I ....
Reverse Funnel System Making Money On Auto Pilot.
(2) Hi Guys This site provides a very best business opportunity making money from online and also
it is a home based business.You can earn money in profit-manner.It also provides Reverse funnel
system making money on auto pilot. Reverse funnel marketing,perpetual leverage payplan,global
resorts network,gold crown resorts,reverse funnel system,ultimate home business,fullyautomated,think
and grow rich,home biz,passive income,no phone calling,ultimate solution to home and so on. Cheer"s
Reverse funnel system making money on auto pilot ....
Where Am I Making Mistake
(10) hello i have just started to learn java by myself and i am stuck here with this example i want to
show a file in console please tell me where am i making mistake. i am getting erroe variable fin
maight not be initialised here is the code CODE /** Display a text file To use this
program,specify the name of file that you want to see */ import java.io.*; class showfile {
public static void main(String args[])throws IOException { int i;
FileInputStream fin; try { BufferedReader br=new....
Ftp In Visual Basic 6.0
Start making your FTP client using VB6 (1) Recently, I had a need to make a FTP client, since our webhosting FTP server was kind of exotic, and
very restrictive, and most of uploads, even though they reach 100% would crash... File would be
uploaded to a server, but FTP clients just froze upon completion, waiting for the 226 (OK) from FTP
server... So, I had to make my own, one who would not wait for 226, but instead, watch the file
pload progress... This tutorial is not fuly complete, in the sense that it does not offer COMPLETE
FTP client functionality (for example, I ddn't write the code for FTP download, ....
Making A Song In Fruity Loops Part Three
part three precusion (1) ok part three now which covers the precusions setup of the small song i built for this tutorial.
the nesecery files can be downloaded here the image below is included in the precusions folder as
it mught not be entierly visable within this post so shold you need it its there also the images
purpose is to enable you to see what i am refering to within this tutorial lateron. now what i
have done above is blackd out every pattern that has nothing to do with the precusion. so the
patterns displayed in light grey are the only patterns i will be refering to. ok lets b....
Making Money From Home
(13) .................................
Runescape 2 Private Server Guide: Part 1
making a private server (16) According to RuneScape TOS, as long as your private server does not connect/interfere with the
actual server this 3rd party software is not breaking the real RuneScape TOS. Please use this
information accordingly. If any RuneScape representative feels that this post is against your TOS,
please contact Trap17 admins via PM or email. Thank you. This is part 1, focused on making a
private server and such, if you would like, i will post more on customization in other parts.
Overview: This guide will explain the basics for building your very own rs private server&....
Best Online Money Making Programmes
(9) check out this website to make a fortune online ....
What Are The Steps To Making A Website?
(19) what are some steps to making a website? im doing a project and i need like 5-7, but id ont know
waht to put. ....
Making Mods
(4) Just wanted to see if we have a modders in this place. If you are modder, hwo did you get yourself
into and what mods of games have you made?....
Making Games
With Game Maker (18) Hi. /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I just
wanted everyone to know(if you didn't know already. /smile.gif" style="vertical-align:middle"
emoid=":)" border="0" alt="smile.gif" />) of a pretty cool program called Game Maker. From my
experience with it, it's very simple, yet you can still make awesome games with it. Now, when I
say "awesome" keep in mind, you won't be able to make games like "Halo" or something like that
with it. But you can make pretty cool games still, it is capable of 2D and 3D games, alth....
Tips For Making New Friends
What do you do when you have no friends (17) maybe im to young or omsehinthing, but everyone else in my school hangs around with their friends.
Im always the one left out:( like when my p.e. teacher tells us to partner up, i can't get any
partners and im always the one that has to join a group of 3's and have to take turns or osme
crap like that. Im the one the no one likes, some of the kids at my school have a girlfriend but I
can't even get ANY friends!This is really making me angry because I want a friend and I hate
the fact that no one likes me and wants to kill me. I even have some kids that ar....
.::gunz Online Clan::.
making a gunz clan lvl 10+ (17) hey im making a gunz online clan you have to be over lvl 10 to get in fill in this form gunz
name: country: plays a week: time(in GBA) play: level:....
Making Winrar Archives
and adding password to winrar archives (13) **** This tutorial will show you how to put files into .rar Archive and pass worded (if wanted)
**** What You Will Need Before continuing you will need a couple of thing, first of all you
need WINRAR , which is a very powerful archive manager. It can reduce size for you email
attachments, decompress RAR, ZIP and other types of files downloaded from the internet. You can get
winrar at http://www.rarlabs.com The other thing is that make sure your using Windows XP because
this is what I used to make this tutorial. I think it works with any other windows not....
Give Me Website Ideas..
Website Ideas : Something original. Ideas for making a site (30) Website Ideas I'm deciding to take down my site, it's getting kind of old and
boring, but I don't want to just stop with having a site. I need some ideas for something that
provides a service of some sort to people. There are millions of blogs, I really don't want to
post about my life on a daily basis anyway. All ideas will be welcomed, I can't seem to think
of anything at all, so Im asking you. What could my new website be about?....
Inbox Dollars
Best Money making Site-I Got Paid (31) Inbox Dollars is a great site that i found when i was browsing around the net. This Site Offers you
3 different reward chioces and they are: - 10000 Banner Imprressions- $10 - Gold Membership
-$17 - Check- $30 I have already gotten the 10000 banner impressoins from them. The ways
you can earn money are: -$5 when you join the site... -$0.01-0.10 for every paid email
-$4 for every survey site you join -Up to $50 for for every offer -Unlimited cash for
games -Umlimited cash for shoppings The offers are very easy to fill out and you ge....
Making Money Creating Logo's
How to make money designing logos using Adobe Photoshop (19) Hey all, Over the last few years I have been experimenting with making money over the internet.
Being a very creative person I naturally took on to web design. However, I soon found that it was
too time consuming for my liking and it rarely paidf off. Whilst playing around with Photoshop
which someone bough me as a present I started to learn the essential techniques of graphic
designers. Before I knew it I was able to make basic logos that could be sold at a price. Not long
after discovering this I found a site that did forum auctions on logos. A customer requests a ....
The Sims 2 Bodyshop
Making clothes for your sims... (36) Hiiiiii Any one playing The Sims 2 must have heard from Bodyshop, or is even very handy with it
and makes his own clothes to use in the game...!! Well Those people I'd like to ask
about some tip or tricks, because, I tried making clothes, and were pretty on the good way so far,
but I just kinda have the feeling I dont know all the tricks yet!! Anybody who is familiar
with this program can leave some tips/tricks, also for others who want to create great clothes for
their sims???? Thanksss so very much, I have this outfit in my head, but have no ide....
Im Making A Mmorpg >>
Have a read... (14) can you give your ideas for my new game. if you want to help me even more then send me a private
message Thanks Tyjotr __________________________________________________ HybridHero - the new 3d
MMORPG (coming soon)....
Looking for tetris, sourcode, making, tetris, c, c,
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for tetris, sourcode, making, tetris, c, c,
*MORE FROM TRAP17.COM*
|
advertisement
|
|