Hey. Any ideas on how I can apply a given text on a certain 2D object, so the text would follow the object shape? Imagine we have this object: http://prntscr.com/gmdv9w I want to be able to type some text in a textbox and have the plugin automatically place in on the marked area. Let me say that I don't even remotely know how can that be done, although I can work something out if you point me in the right direction. This should preferably be done in JavaScript. If you need any more details, let me know. Thanks!

Member Avatar
Member Avatar
+0 forum 2

How to get min/Max value of a all column in a two-dimensional arra so for example, lets say you have the following 2d array: 1 2 3 4 5 6 7 8 9 Than the out put should be: -- col 1 -- min value at col 1 is 1 max value at col 1 is 7 -- col 2 -- min value at col 2 is 2 max value at col 2 is 8 -- col 3 -- min value at col 3 is 3 max value at col 3 is 9 public static void col(int[][] array) { for …

Member Avatar
Member Avatar
+0 forum 1

* I have to make a maze with 21 rows and 77 columns, allow some for the user's input and for messages. * It also has to have A multidimensional array containing the board. * A function to print the board. * Find the user's starting location (i.e. the location of the 'i') * Loop forever, doing the following: Print the board (using your handy board printing function) If the character is: 'w': move the 'i' up, if possible 'a': move the 'i' left, if possible 's': move the 'i' down, if possible 'd': move the 'i' right, if possible …

Member Avatar
Member Avatar
+0 forum 3

can any body please tell me that how to take input size of a matrix in 2 d array an then print the table of it.... sample output 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25

Member Avatar
Member Avatar
+0 forum 2

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 y, int width, int height)` I would obviously need a GameObject Class, which I have below, and I do check for an intersect, but I don't think that would actually check for collision because I dont know where it should be called. Also, how would you know which parameters to …

Member Avatar
Member Avatar
+0 forum 4

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
Member Avatar
+0 forum 1

Hi, I am creating a project which is a remake of a game so I want to be able to read a map from a Notepad file and store the location and character in the file so I can place a selected image in the location on the grid that I have already ceated. My text file looks like this: 8,8 00111000 00131000 00101111 11120231 1302c111 11112100 00013100 00011100 The "8,8" is the size of the map. In my game, the player gets to choose the character that they will use (the character is represented in teh text file with …

Member Avatar
+0 forum 0

I have a text file transa.txt .I want the contents of the file to be filled in the array cell by cell.example the file reads: 1 1 1 1 0 0 1 0 1 1 1 1 so i want arr[0][0]=1,arr[0][1]=1,arr[0][2]=1...... Can someone please help me with this..I am stuck with this.

Member Avatar
Member Avatar
+0 forum 3

Here i have this code which read from a text file and fills the 2d array.Then calculates the sum of each column.I want all those column names whose sum is greater than 5 to be written in output file. /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package javaapplication30; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; /** * * @author anku saxsena */ public class JavaApplication30 { /** * @param args the command line arguments */ public static void main(String[] args) { BufferedReader br = null; String[] line=new String[55]; int …

Member Avatar
Member Avatar
+0 forum 1

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) { int highestRow = numbers[0][0]; for (int col = 0; col < numbers[row].length; col++) { if (numbers[row][col] >= highestRow) highestRow = numbers[row][col]; } return highestRow; } If you need to see the rest of my code let me know i will gladly show it.

Member Avatar
Member Avatar
+1 forum 6

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 follow, not zoom or rotate or anything like that. Any responses will be greatly appreciated!

Member Avatar
Member Avatar
+0 forum 2

A program which has the main process as Director process, which reads a file containing marks of all quizzes of all sections and creates x number of Manager processes. Each Manager process will take care of solving for a section. Each manager process will create y number of worker process and pass one quiz to each of them and they calculate and print the average. HINTS There are x number of sections in a course. In each section y numbers of quizzes are conducted. The average for each quiz in all the sections needs to be found out. Read x …

Member Avatar
Member Avatar
+0 forum 2

#include <time.h> #include <math.h> #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #define ROW 9 #define COL 9 int printboard(int grid[ROW][COL]){ int x,y,n,chk; srand(time(NULL)); for(x=0;x<ROW;x++){ for(y=0;y<COL;y++){ do{ n=rand()%7+2; grid[x][y]=n; if (((grid[x][y]==grid[x-1][y]) && (grid[x][y]==grid[x-2][y])) || ((grid[x][y]==grid[x][y-1]) && (grid[x][y]==grid[x][y-2]))){ chk=1; continue; }else{ chk=0; printf("%d ", n); } }while(chk==1); } printf("\n\n"); } } int welcome(char name[20]){ printf("********************WELCOME********************\n"); printf("*****************NUMBER CRUSH******************\n\n"); printf("Please key in your name:"); scanf("%s",name); printf("***Good day %s,let's start a new game...all the best!!!***\n\n\n", name); fflush(stdin); return 0; } int menu(c){ int choose; do{ printf("*MENU\n"); printf("*Press 2 to move down\n"); printf("*Press 4 to move left\n"); printf("*Press 6 to move right\n"); printf("*Press 8 to …

Member Avatar
Member Avatar
+0 forum 4

[CODE]import java.util.* public class ArrayMinMax { public static void main(String[] args) { Integer[] numbers={8,2,6,7,1,4,9,5,3}; int min=(int)Collections.min(Arrays.asList(numbers)); int max=(int)Collections.max(Arrays.asList(numbers)); System.out.println("Min number: "+min); System.out.println("Max number: "+max); } }[/CODE] Hi guys, me again. Okay so I use this code in a single array if i want to know what the minimum and maximum numbers are. Now i'm trying to figure out how to implement the same program in a 2d array, with a 3x5 matrix and the user has to input the columns. [CODE]import javax.swing.*; import java.util.*; public class CMPROG2threeXfive{ public static void main(String[] args){ int[][] matrix=new int[3][5]; for(int row=0;row<matrix.length;row++){ for(int col=0;col<matrix[row].length;col++) matrix[row][col]=Integer.parseInt(JOptionPane.showInputDialog …

Member Avatar
Member Avatar
+0 forum 6

I want to write a class that do operation on two matrices by 2D vector but i have some problems with the 2D vector , any one can help me?

Member Avatar
Member Avatar
+0 forum 7

I have an array of elements. Think each of the element as competitors, and a tournament is going to rank them. The output of the program is showing elements at each level. Here's the code: #include <stdio.h> #include <stdlib.h> bool isPowerOfTwo (int x) { /* First x in the below expression is for the case when x is 0 */ return x && (!(x&(x-1))); } // modified int log_2(unsigned int n) { int bits = 0; if (!isPowerOfTwo(n)) bits++; if (n > 32767) { n >>= 16; bits += 16; } if (n > 127) { n >>= 8; bits …

Member Avatar
Member Avatar
+0 forum 7

I am having trouble with the last three methods of my program in the **Board.java**. I'm not sure how to go get it to read gameBoard. It keeps giving me errors. I really cant figure out what I'm doing wrong. All the methods were given to me and cannot be taken out or put in different classes. **Board.java** import javax.swing.JOptionPane; public class Board { private char player1; private char player2; private int playerTurn; private static final String EMPTY = null; private static final char BLANK = 0; private char[] current = { '1', '2', '3', '4', '5', '6', '7', '8', …

Member Avatar
Member Avatar
+0 forum 9

> hey guys, how to get min value in array 2D except value zero '0'and also key ? > i've try use min and array_filter function to solve it > can you help me?please Array ( [0] => Array ( [0] => 0 [1] => 6 [2] => 4 ) [1] => Array ( [0] => 6 [1] => 0 [2] => 2 ) [2] => Array ( [0] => 4 [1] => 2 [2] => 0 ) ) i want result like this: Array ( [1] => Array ( [2] => 2 ) )

Member Avatar
Member Avatar
+0 forum 1

I've wrote a game. But when I compile, and run the main method, there is an error, saying: No main methods found or something like that. I have one class called Game.java, which is supposed to be the main one, and gameLoop.java. For unknown reasons, gameLoop doesnt want to compile. This is my Game.java class: import java.applet.Applet; import java.awt.Graphics; public class Game extends gameLoop{ public void init(){ setSize(854,480); Thread th = new Thread(this); th.start(); offscreen = createImage(854,480); d = offscreen.getGraphics(); addKeyListener(this); } public void paint(Graphics g){ d.clearRect(0,0,854,480); d.drawOval(x,y,20,20); g.drawImage(offscreen,0,0,this); } public void update(Graphics g){ paint(g); } } And this is …

Member Avatar
Member Avatar
+0 forum 9

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 detection with my shoots, I don't know how to make it. So would really appreciate any help I could get. Feel free to tell me if anything is wrong or could be better and use this code for your own learnings. And I know its a bit messy but I …

Member Avatar
Member Avatar
+0 forum 11

Hi I'm new to Python and have the following problem. I have a excel file (csv format) that I want to open and display as a 2d list. I can read the file but can not get anyother output other than the colum headings as a single letter [h][e][a][d][i][n][g] I would like to display the file in a list as it is in the file: [[heading1][heading2][heading3] [the] [cat] [sat] [on] [the] [mat]] I have the following code but can't seem to get it to work as I wish # Use the a file reader function to open the file, assign …

Member Avatar
Member Avatar
+0 forum 1

I need help with 2d arrays i've posted the problem here [Click Here](http://www.java-forums.org/new-java/71879-please-help-me-im-almost-there.html) (i've posted the problem on java-forums as well) Could someone please tell me what i'm doing wrong or how i could fix this? Thanks!

Member Avatar
Member Avatar
+0 forum 3

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 inputs. That means that it has 8 outputs (2^(numberOfInputs) = 8). I need a method to write this (example of 3 inputs): |0|0|0| |0|0|1| |0|1|0| |0|1|1| |1|0|0| |1|0|1| |1|1|0| |1|1|1| Notice the third column (actually called column 0, the middle one would be 1, the most left one 2). 2^0 …

Member Avatar
Member Avatar
+0 forum 4

Hi How do I go about reading from a file (Input_image.txt) that contains a 2-D (50 by 100 = 5000 elements) array? E.g. > 000 004 567 034 ... > 001 046 923 987 ... > 004 345 003 745 ... > 034 870 003 805 ... > 054 345 025 545 ... Each the spaces seperate with element. My flaw code in question void Data_Manu_Proc() { myFile = fopen("Input_image.txt","r"); for (i=0; i<50; i++) { for (j=0; j<100; j++) { fscanf(myFile,"%03d", &image_read[50][100]); } fclose(myFile); } }

Member Avatar
Member Avatar
+0 forum 3

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 data from the XML file that i created * with all the module details such as Name, Semester, Prerequisite e.t.c. */ XmlDocument xm = new XmlDocument(); string list = "/modules/module/name"; //selects precise tag xm.Load(@"C:\Users\Ahmad Panezai\Desktop\info.xml"); //path where I have saved the xml file (My desktop) XmlNodeList Xn = xm.SelectNodes(list); foreach …

Member Avatar
Member Avatar
+0 forum 11

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 matchTime() { for (var i=0;i<timers.length;i++) { timeCheck = setInterval(function () { var theDate = new Date(timers[i][0]*1000); var now = new Date(); if ( (now.getFullYear() === theDate.getFullYear()) && (now.getMonth() === theDate.getMonth()) ) { if ( (now.getDate() === theDate.getDate()) && (now.getHours() === theDate.getHours()) ) { if ( now.getMinutes() === theDate.getMinutes() && (now.getSeconds() …

Member Avatar
Member Avatar
+0 forum 1

void drawMap(std::string MapLoc) { char* gridMap[95] [55]; ifstream Map(MapLoc, ifstream::in, ifstream::binary); while (Map.good()) { for(int i = 0; i < 95; i++) { for(int j = 0; j < 55; j++) { if (gridMap[i] [j] == "X") { //Draw Wall glColor4ub(255,255,255,255); glBegin(GL_QUADS); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glEnd(); } else if (gridMap[i] [j] == ".") { //Draw Space glColor4ub(0,0,0,255); glBegin(GL_QUADS); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glVertex2f(10*i,10*j); glEnd(); } else if (gridMap[i] [j] == "C") { //Draw Char } else if (gridMap[i] [j] == "O") { //Draw Opponent } } } } Map.close(); } I need to read characters from a text file into …

Member Avatar
Member Avatar
+0 forum 5

Hi, i'm new to c# and need help on designing a programme. I need to create a 2d array which has to accept 12 values (3 verticalx4 horizontal)(with decimal places) . I have to be able to input the values of each element in the area using the console. I am having trouble doing this and any help would be appreciated

Member Avatar
Member Avatar
+0 forum 6

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; int i=0; while(k<2) { k++; while(i<80) { GRID[k][i] = asterisk; i++; } cout << "\n" ; i=0; } //----------------------------------------------------------------------------------------------------- //plaintext input into GRID char plaintext[0]; cout << "Enter message to encode:" << " NOTE:Asterisk(*) symbol is not allowed\n"; cin >> plaintext; int grid_row[5] = {0,1,2,1,99}; //012101210121 is pattern and 99 …

Member Avatar
Member Avatar
+0 forum 4

Hi, can u all help me with a question. I have been given two boolean 2d square arrays. 1st array is one having random true or false values. 2nd array is with all true values. Suppose eg n = 4; 1st array : false true false true true true true true false false false true false true true false In this array there are two connected segments(the ones with true values). 1st is (0,1)-(1,1)-(1,0)-(1,2)-(1,3)-(0,3) 2nd is (3,1)-(3,2). What we have to do is - from each connected segments select topmost-leftmost element (1st priority is top, 2nd priority is left) and …

Member Avatar
Member Avatar
+0 forum 1

The End.