How would the remaining cases look like? I sorta remember my instuctor talking about using either division or modulo(%)?
Type: Posts; User: Dylan Metz
How would the remaining cases look like? I sorta remember my instuctor talking about using either division or modulo(%)?
Here is what I have so far:
#include <iostream>#include <string>
using namespace std;
//recursive function prototype
string intToStr(int n);
So it would be like this? if(n==0) return 0?
How would you return it as a string? Also could you also provide some advice on the main function? Would I be using the same main function as I did for...
Not sure about static variables. As for intToStr. I haven't started it yet. I would like some help with the base case of the recursive part.
We are not allowed to use any functions that are similar to atoi or itoa. We also cannot use for or while.
This is my other function that converts the string to an integer:
int...
I already completed one part of the assignment, but need help on the other part. The assignment was to create two recursive functions. One that converts strings to integers ( which i completed) and...
I need help from stopping shapes from going right through other shapes. Someone said I needed a board matrix, but I have no Idea how to set that up.
Right now I have all movement and roation done...
Here is what I am currently trying to do:
rotation in shape class:
void Shape::rot(int x , int y)
{
int xp, yp;
xp=x-y+y; //x-y is pivot points
yp=x+y-x; //x+y is pivot points
Thank-you for all the help in getting me started. I have one more question right now. Where to put all the code? Do I make a function or do I add it to a class?
My c++ teacher gave a lecture of rotating the pieces. but I am so confuse. I do not know where to put the code or how to call it. Do I put in one of the classes?
My teacher gave us something like...
I said in the last post that I need help getting started with setting up rotation of the shapes. I have no idea how set it up or where to put it.
I need help getting started with rotation of shapes in tetris c++ game made with darkGDK.
Here is the current code:
//Dark GDK - The Game Creators - www.thegamecreators.com
//the wizard has...
Okay the movement is working now, but when the shape hits the side(s) it stops moving.
code:
//Dark GDK - The Game Creators - www.thegamecreators.com
//the wizard has created a very simple...
I fixed the code in post #1. I now having no errors, but it barley recognizes when the left or right key is pressed.
Okay I fixed the error, but now I am having trouble with the code not recognizing when the left or right key is pressed. You need to hold down the key for it to move.
code:
//Dark GDK - The...
I am making a tetris game for my intro c++ class. It is in c++ using Dark GDK.
I am getting one error:
1>i:\ school\ spring 2012\comsc-048\tetris code\tetris code\tetris code\tetris\dark gdk...
My intro to c++ class is making a tetris game for a project.
My code can be found here: [C++] TETRIS C++ -ERRORS- - Pastebin.com
or here:
//Dark GDK - The Game Creators -...
Okay here how's this:
void NextState (char board[][COLS]){
char board2[ROWS][COLS];
//int LiveCnt=0;
for (int r=1; r<ROWS-1; r++)
{
int LiveCnt=0;
for (int c=1; c<COLS-1; c++)
{
Okay this is what I have so-far:
#include <iostream>
#include <string>
#include <fstream>
I know what I need to do, but this is where I'm stuck. How do you check the neighbors of the LIVE cells. I know you need to use a lot of IF statements, but I really do not know how to get started on...
//Game of Life
//Dylan
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
//Global Variables
const int ROWS = 12;
const int COLS = 30;
const char LIVE = 'x';...
okay I looked it over and compared what you did. Now I can I print the board to see if it is printing right?
Here is what i tried with your code:
//Game of Life
//Dylan
#include <iostream>...
I will look over the changes you made in more detail tomorrow when I am in front of my windows desktop that has dev-c++ on it.
Thank-you!
Okay here is my new code. Is it better? I am also now getting[link error]
code:
//Game of Life//Dylan
#include <iostream>
#include <string>
#include <fstream>
I am not asking anyone to do it for me. but help me get started on the last part. I do not know how to start and because of budget cuts to my college their is limited resources from the tutors at the...