C/C++ :: Forming Triangle With Border And Fill Characters?
Jan 22, 2014
This code is for a member function called Triangle. It's a Draw() function that uses border characters and fill characters. I've been trying to work it out in a seperate file just so I can get it to work before I add it to my function definition.
#include <iostream>
using namespace std;
int main() {
for(int i=1; i<=8; i++) {
for(int sp=1; sp<=8-i; sp++) {
[code]....
I haven't attempted the fill characters (well... I have, but it was so wrong it was ridiculous). I need to get rid of the extra '*' at the very top. Here's an example of what this should look like...
*
*#*
*###*
*#####*
*#######*
*#########*
*###########*
* * * * * * * *
View 9 Replies
ADVERTISEMENT
Oct 9, 2014
I'm in need of an algorithm to find the points within a triangle(vertices are known. 3d coordinates). The points are to be at same distance from one another i.e. the points are uniformly distributed within the triangle.
I have done a search about the topic and have come across some ideas like lattice points generation ,tiling polygons with Lattice triangles [URL] .... and taking their centroids as the points.
View 1 Replies
View Related
Oct 9, 2013
I just started Linear Algebra for my programming degree and to full understand everything I want to put it into code and make my own "matrix calculator." I have all the theory but I am having issues keeping the matrix variable and moving it around the class' functions to create it and output it. Once I know I have it saved I think I can get the addition/multiplication to work. Here is the code I have so far:
#include <string>
#include <iostream>
using namespace std;
class matrix {
[Code] ....
View 5 Replies
View Related
May 10, 2012
I am trying to form unique string from other string which is having multiple presence of same word as,
string testA = "one
two
three
four
one
seven wo";
now new string should contain single occurrence of words "one" and "two" so that new string will look like,
string testB = "one
two
three
four
seven"
View 3 Replies
View Related
Mar 6, 2015
I am trying to create a border around my program. It looks like this: . I had to read a file in, which is in the attachment and produce the desired output in the image. I have produced the desired output, but without the border.
Here is my code thus far:
insert Code:
#include<stdio.h>
#include<Windows.h>
#define HEIGHT 21
#define WIDTH 78
int map[HEIGHT][WIDTH];
int i = 0, j = 0;
[Code] ....
View 2 Replies
View Related
May 9, 2013
how to display the other half of the box's border? where should i put the printf? or is there any other method that you can show me using arrays?
Code:
#include <stdio.h>
#define ROW 15
#define COLUMN 15
void disp_box (char b[ROW][COLUMN])
[Code].....
View 9 Replies
View Related
Mar 6, 2015
I would like to draw a border arround a cell in a TableLayoutPanel but without also making a connection between the columns. I just want an outer border.
private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e) {
if (e.Row == 0) {
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Right, e.CellBounds.Top));
e.Graphics.DrawLine(Pens.Black, new Point(e.CellBounds.Left, e.CellBounds.Bottom), new Point(e.CellBounds.Right, e.CellBounds.Bottom));
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Left, e.CellBounds.Bottom));
}
}
This line
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Left, e.CellBounds.Bottom));
also paints connections, where i don't want them. How can i just make a outerb order arround a cell and is there a easier way to do it? Here's also an image of what i want. I don't know if i described it right.
View 2 Replies
View Related
Oct 7, 2014
So in my winform form, I have a table layout panel and I attach Controls on the row. I make some control span multiple columns... But since I use transparent for the background of the layout panel, it show the border between 2 cells that I span.. Like this:
How do I erase the border in the middle of IDLabel?
View 14 Replies
View Related
Sep 9, 2013
Here is my source code i am trying to write a function (fillAll) to fill all 52 cards in a deck and i would like to use my data struct for the function and make Deck one of my parameters.
enum suit{HEARTS, CLUBS, DIAMONDS, SPADES};
enum face{TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE};
struct Card{
suit suitType;
face faceType;
[Code] .....
View 10 Replies
View Related
Jul 19, 2013
so im trying to make a background for a menu, but it is only so big. its not the kind of picture where i can just reapply it. is there a function to make it fill to the screen?
View 4 Replies
View Related
Apr 2, 2014
So this is my working code with sql i want convert it so i can read it from xml, basiccl i need to fill empty list with xml column BrivDat..
var connStr = @"Data Source=(LocalDB)v11.0;" +
@"AttachDbFilename=C:dbaseAdaPlus.mdf;Integrated Security=True";
List<DateTime> Holidays = new List<DateTime>();
using (SqlConnection conn = new SqlConnection(connStr))
using (SqlCommand cmdd = new SqlCommand("select * from Brivdienas", conn))
[Code] ......
View 5 Replies
View Related
Mar 20, 2014
so my question is i want to print characters,no string just an array of characters,i do this but it s not working,maybe i have to put the '' at the end?
Code:
int main() {
int i;
char ch[5];
for(i = 0; i < 5; i++) {
scanf("%c",&ch[i]);
[Code]...
View 6 Replies
View Related
Jul 6, 2014
Im supposed to find the common characters between two string characters, assuming that the user wont input duplicate letters like ddog. When I run my code I get an output of a question mark upside down. Here is my code with comments on what each part is supposed to do
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char str1[20], str2[20],remp = '