35 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Doogledude123

I am trying to determine collision in a 2D Side Scroller environment using Rectangles. However, the way most people do it is to get the bounds of the Tile. I do not use Tile's in this case, I am just drawing Simple Full Colored Rectangles using Graphics2D. `g.drawRect(int x, int …

Member Avatar for jwenting
0
481
Member Avatar for ravi_14

i found following code to create a two dimensional array at run time if one of the dimension is known.. char (*c)[5]; c=new char[n][5]; first line is pointer to an array of 5 integers but i couldnt undesratnd the second step.

Member Avatar for Ancient Dragon
0
289
Member Avatar for lauren.vitiello.12

I am trying to get the highest value in my rows. I have been at this awhile trying to figure it out. I assume it is suppose to return 3 values but honestly i really suck at this. Here is what I have public static int getHighestInRow(int[][] numbers, int row) …

Member Avatar for scudzilla
1
329
Member Avatar for CJMW

So i'm making an rpg game in xna. I can move my player around the screen, however it can also move off the screen. How can I implament a simple camera that will follow the player and prevent them from moving off of the screen? I only need it to …

Member Avatar for CJMW
0
433
Member Avatar for Necrozze

Im making a 2D platformer-ish shooter its really simple and not much effort put in it, it is my first game Im making in python and its for a school project and needs to be finnised really soon. Everything is working just fine but Im having problem with some collision …

Member Avatar for Lucaci Andrew
0
550
Member Avatar for Pobunjenik

Hi! It's me again and [this](http://en.wikipedia.org/wiki/Decoder) is a decoder! **The goal:** And I'm trying to make a program that solves logical problems related to the decoder device. For that I need a loop that write true/false into a boolean[][] based on the rules. Say we have a decoder with 3 …

Member Avatar for Pobunjenik
0
431
Member Avatar for ahmzy

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using System.IO; namespace Enrolement { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { /* This part of my code imports the …

Member Avatar for ahmzy
0
1K
Member Avatar for ckjaseem

Hi all , I have a set-interval function inside a for loop and when inside the set-interval function if it meets a criteria give an alert and clear the interval. Below is my code but its not working can anyone tell what the mistake here. var timeCheck = 0; function …

Member Avatar for LastMitch
0
486
Member Avatar for 111100/11000

http://en.wikipedia.org/wiki/Transposition_cipher#Columnar_transposition This is wiki site of what am trying to do #include <iostream> #include <cstring> #include <cmath> using namespace std; char GRID[3][80]; int MENU(int menu_choice); int REVIEW_OF_GRIDS_FIRST_79_CHARACTERS(int four); int main() { cout << " This is RAIL FENCE CIPHER\n" << endl; //----------------------------------------------------------------------------------------------------- //filing GRID with asterisks(*) char asterisk='*'; int k=-1; …

Member Avatar for Gonbe
0
2K
Member Avatar for ShEeRMiLiTaNt

Hello, I need to write a program to take in a name (max 101 characters) and out store in into an array so that I can output it like a list. These 2 programs are apart of a bigger program that keeps asking if you want to add another name …

Member Avatar for VernonDozier
0
321
Member Avatar for sandorlev

Hey guys! I've started writing a 2d platformer game some days ago, and I'm really enthusiastic about it, but I already failed to live up to my own expectations: I just cannot possibly think of a way I could make my character jump. I used the MVC desing is why, …

Member Avatar for 3e0jUn
1
339
Member Avatar for ttugates

Hi, I am writing a program that displays a 2D array of strings, (non jagged) onto a windows form using Visual Studio 2010 and C#. For example: string[,] fds = new string[,] {{"ant", "aunt"}}; I attempted using the dataGridView controll, dataGridView1.DataSource = fds; but, get the length of the value, …

0
90
Member Avatar for JOSheaIV

So first of all let me say I am pretty new to C++ and find it very difficult to learn (especially when compared to say C#) Anyway I am working on a program that requires the use of a 2D array or a similar container. After talking with a professor …

Member Avatar for JOSheaIV
0
3K
Member Avatar for nandosss

I need help creating a two dimensional array in mips assembly. I am new to this kind of programming and i do not know how to approach the problem. i have to create an array max size 20 by 20 and then fill it up with data entered by the …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for themenucha

Hi!!! I'm trying to pass 2d array to function and i can't. In general i'm trying to print chess board in action. The board is an integer.I need a function that gets 2d array in specific place and returns correlatedm char. const int pawn = 1; const int rook = …

Member Avatar for themenucha
0
348
Member Avatar for Goshutu

Hi, i am doing a multiple-file project and i come across a difficult obstacles. I want your help, DaniWeb readers on this problem, which i find very strange: [CODE] #include "stdafx.h"//i have included vector header here #include "globals.h" #include "functions.h" using namespace std; #ifndef CPIECE #define CPIECE class CPiece { …

Member Avatar for Goshutu
0
331
Member Avatar for bennetk2

I am having problem with converting and initializing errors. Any help is appreciated. I am a 2 yr Computer Science major, so be gentle. Here is Code: Sorry its long! [CODE]// Kyle Bennett // CS 318 // Paint Throwing Disturbance #include <iostream> #include <iomanip> // set width and decimal #include …

Member Avatar for raptr_dflo
0
359
Member Avatar for anu07

The output I expected was: [ICODE]alpha beta[/ICODE] I used the following code: [CODE]#include<iostream.h> #include<conio.h> void main() { clrscr(); char choice[2][5]={"alpha","beta"}; cout<<choice[0]<<endl; cout<<choice[1]; getch(); }[/CODE] But this is what comes: [ICODE]alphabeta beta[/ICODE] Can anyone tell me what I did wrong? Thank you. P.S.:I know I am not using standard c++, but …

Member Avatar for anu07
0
174
Member Avatar for ba.accounts

Hi, Just wondering if anyone has any example of reading data from a file and storing it into an uneven 2D array. For example: the file contains [a,b,c] [a,b,c,d] [a,b,] etc I am able to do this with a complete "square" or matrix but when the columns aren't even I'm …

Member Avatar for ba.accounts
0
2K
Member Avatar for mattyg1192003

Hey Guys, I am a new student to Java and I am working on an assignment for school. I am not looking for anyone to do my work for me, just some guidance on what I can do to fix the problem. I have done research on this issue on …

Member Avatar for AhmedGhazey
0
3K
Member Avatar for leetari

Hi there, I am working with a 2D array, my c++ program reads input from an external file and stores it into a 2D array. Say, for example, this is my input file: 9 5 6 2 4 1 0 8 6 7 3 5 2 9 5 8 My …

Member Avatar for leetari
0
3K
Member Avatar for jshoot

Hi everyone, I have a 2d array whith 50000 lines and 14 columns, and I have to sum/multiply each value of a column for a fixes numbers, like this: a[1][14] = 0 a[1][14] + 2 = 2 a[2][14] = 2 a[2][14] + 2 = 4 a[3][14] = 5 a[3][14] + …

Member Avatar for zeeshan soomro
0
694
Member Avatar for gingerfish

i have this 2d array: String[][] testData= { {"s", "y", "r"}, {"s", "n", "r"}, {"w", "y", "r"}, {"s", "n", "r"} }; how can i count the occurrence of a particular element in the column of an array? for example i want to know how many "s" are in first column …

Member Avatar for gingerfish
0
3K
Member Avatar for Prosper92

So I've been giving a number of assignments to do but I'm stuck on one in particular now. I've to create a 2D array ([5][2]) and then say how many times ou of the 5 rows that the first row was bigger than the second. I imagined I would need …

Member Avatar for Taywin
0
1K
Member Avatar for Splam Bub

Hello DaniWeb! I'm trying to return an array of strings from a function but I'm not sure how to do so. I've done the prerequisite Googling and have found people on this discussion board recommending to return char** which, it is said, can then be converted back into 2d array …

Member Avatar for Splam Bub
0
152
Member Avatar for JordanHam

I do not know if I should use a 2D or just two seperate arrays to make this easier. I have two arrays. One is just an array like {1,2,3,4...n} and the other has values that correspond to those and make pairs. I want to create an array that stores …

Member Avatar for JordanHam
0
197
Member Avatar for AaronLLF
Member Avatar for dorien

Hi, I want to copy a row from a 2d vector in an existing 1d vector. I found a similar tread, which copies into a newly defined vector as such: [CODE]vector< data_type > copyRow( vec2d[3].begin(), vec2d[3].end());[/CODE] Now I want to change this code, so that copyRow already exists. My idea …

Member Avatar for dorien
0
1K
Member Avatar for gingerfish

Hello I have a code here. it generates random 2d array [B]kMean[2][3][/B] and then this program calculates the distance between random generated [B]kMean[2][3][/B]s and [B]data[][][/B]. but the problem is, when the random kMean is 1, then it calculates the distance, but when the number or kMean becomes more than one, …

Member Avatar for gingerfish
0
130
Member Avatar for Lord_Migit

hey folks, i have a problem which seems to be reasonably simple but i havnt managed to figure it out yet. Iv read alot of the other threads on this but i still havnt found one that iv both understood and solved my problem. So here goes... Its concerning returning …

Member Avatar for Lord_Migit
0
131

The End.