# Search:

Type: Posts; User: rossipoo

Page 1 of 2 1

1. ## Thread: Help with C programming!

by rossipoo
Replies
7
Views
1,058

### You've got the basics, now you need to use them...

You've got the basics, now you need to use them to build up more and more until you have a complete solution. The next step is to make a function that evaluates a single term. Each term has this...

by rossipoo
Replies
5
Views
1,496

### This is what I did and it ended up working good....

This is what I did and it ended up working good. Thanks,

by rossipoo
Replies
5
Views
1,496

### I don't have a list of perimeter points, I have a...

I don't have a list of perimeter points, I have a list of elements (squares) from my 2d array that are touching the perimeter, and they are not in-order because I am using a recursive method to find...

by rossipoo
Replies
5
Views
1,496

### Area Perimeter

I have a two dimensional array with some of the elements marked, in essence like the image below. I want to calculate the points needed to draw an outline around the marked elements. In this case it...
5. ## Thread: Perfect and Prime numbers

by rossipoo
Replies
3
Views
2,718

### You have all the right parts, yet the solution is...

You have all the right parts, yet the solution is unnecessarily complex.

A more concise solution. It only does one number, you should be able to make it repeat until the user types in an...
6. ## Thread: Perfect and Prime numbers

by rossipoo
Replies
3
Views
2,718

### What's wrong here?: if (!prime) { cout...

What's wrong here?:

if (!prime) {
cout << "The number is prime.";
}

There's probably more, but that's one thing.
7. ## Thread: Quick help for a college student :/

by rossipoo
Replies
2
Views
713

### The behavior of this program will not be correct...

The behavior of this program will not be correct if only a one or two digit number is given.

by rossipoo
Replies
5
Views
3,140

### I'm not sure how you are representing the maze...

I'm not sure how you are representing the maze data. But you need to be keeping track of the steps you have taken as you traverse the maze. You could have an array, and each time you take a step, add...

by rossipoo
Replies
3
Views
1,298

### The secret reffered to is a basic flood fill....

The secret reffered to is a basic flood fill. Check Wikipedia.

You need to iterate through every cell, and attempt to do a flood-fill for white. If it's successful, you add to a numberOfAreas...
10. ## Thread: Insert new element into a vector

by rossipoo
Replies
7
Views
8,737

### What probably was wrong is that somewhere in the...

What probably was wrong is that somewhere in the code that you have simply as ..... , you are changing the size of vector v. If you change a vector, any previously created iterators will become...
11. ## Thread: drawing a square with loops

by rossipoo
Replies
10
Views
13,725

### The code needed for drawing the top and bottom...

The code needed for drawing the top and bottom rows is different than that needed for the middle rows. Therefore, it makes sense to separate it. It could be crammed into one loop, but it doesn't make...
12. ## Thread: Why is goto the devil and exiting programs question.

by rossipoo
Replies
55
Views
3,926

### Actually, having a function call itself...

Actually, having a function call itself recursively on invalid input is probably not the best method. Since you only want the instance with valid input to do anything, you may as well not be calling...
13. ## Thread: Why is goto the devil and exiting programs question.

by rossipoo
Replies
55
Views
3,926

### Here is an illustration of how much using loops...

Here is an illustration of how much using loops can improve the readability of code. I'll use loops and gotos to solve a simple problem, creating a multiplication table:

Using for loops:

for...
14. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### Not directly, but you can use a string inbetween:...

Not directly, but you can use a string inbetween:

char input;
string inputString;
getline(cin, inputString);
input = inputString[0];
15. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### This could be because there is leftover in the...

This could be because there is leftover in the input buffer after the cin >> input; line.
Using cin for anything other than strings can be unreliable. You could try changing the line cin >> input;...
16. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### Can you tell why it's staying in the same room?...

Can you tell why it's staying in the same room? You can use a debugger to find out exactly what code is being run when. If you pay careful attention to the output, the exact point at which something...
17. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### The logic could be reworked. Like so: while...

The logic could be reworked. Like so:

while (true) {
// ... display possible directions for travel

// Get input and decide where to go next.
char input;
cin >> input;
18. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### It's quite simple really. Assuming this is your...

It's quite simple really. Assuming this is your current code to move north:

player.location = player.location -> north;

All you have to do is change it to:

19. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### Just like how you don't need a separate function...

Just like how you don't need a separate function to move north for each room, despite the fact that north is different in each room, you also don't need separate question functions. Instead you need...

by rossipoo
Replies
2
Views
909

### argc (argument count) is an integer representing...

argc (argument count) is an integer representing the total number of arguments, including the name of the application

argv is an cstring array with the arguments, argv[0] is the first argument...
21. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### Oh, that probably means that the linked rooms are...

Oh, that probably means that the linked rooms are not being initialized to zero. It was working for me in GCC, but it wasn't really proper coding; I should have added it before. To initialize them,...
22. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### Import? Don't worry about that, just use...

Import?

Don't worry about that, just use include. I copy-pasted out of my "Test" project I use for anything random like this, so there was other unrelated code. Otherwise you can actually compile...
23. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### You could expand a room to be whatever you like....

You could expand a room to be whatever you like. You want to be able to move around inside the room? Have monsters? Treasure? It's all up to you. You cam see the o ly thing I implemented was a name...
24. ## Thread: Moving between areas

by rossipoo
Replies
100
Views
5,937

### Here is a simple room class and a navigating...

Here is a simple room class and a navigating application:

#import <string>
#import <iostream>

// A very simple room class
class Room {
public:
string description;
25. ## Thread: C++ Quiz Problem

by rossipoo
Replies
13
Views
1,303

### There is an excess semicolon after main(), and...

There is an excess semicolon after main(), and another after while(). Your code block brackets don't match. You always begin a block with {, and end with }. If you start, you must end it, therefore...
Results 1 to 25 of 38
Page 1 of 2 1