C :: Draw Magen David Star
Apr 18, 2014
problem to draw magen david star ,i find code that draw pyramid of starts. how can i modify this code to receive magen david star ?
Code:
#include <stdio.h>
int main() {
int rows, star, spaces;
char bukva='A';
int number_of_stars = 6;
int number_of_rows = number_of_stars;
[Code]....
View 4 Replies
ADVERTISEMENT
Dec 23, 2014
I use photos to express it. The answer is:
Code:
int main(int argc, char *argv[], int n) {
int i,j;
for (i=1;i<=n/2+1;i++) {
[Code]....
View 3 Replies
View Related
Mar 7, 2015
When i set any 3 inputs length, the space should be move in right position. I try to fix the space move forward into 1 space, but don't know why it doesn't work. Specially, when the number is 4 or 5. The space didn't move 1 space.
using System;
class length{
static void Main(){
int i,j,k;
string star = "*";
string s1 ="";
string s2;
int[] nums = new int[] {3,4,5};
[Code] .....
View 2 Replies
View Related
Apr 19, 2015
Consider a coordinate system for the Milky Way, in which the Earth is at (0; 0; 0). Model stars as points, and assume distances are in light years. The Milky Way consists of approximately 1012 stars, and their coordinates are stored in a file in comma-separated values (CSV) format one line per star and four fields per line, the first corresponding to an ID, and then three floating point numbers corresponding to the star location. How would you compute the k stars which are closest to the Earth? You have only a few megabytes of RAM.
View 1 Replies
View Related
Sep 13, 2013
I have written a star pyramid program, it adds two stars at a time but I want to rewrite the program so the stars double each time.
#include<iostream>
using namespace std;
int main() {
int a = 0, b = 8;
for (int c = 1; c < 10; c++) {
for (int space = b; space > 0; space--)
[Code] ...
View 1 Replies
View Related
Oct 5, 2014
I am trying to write a program that will make a pattern of stars. The last line is really tripping me up. I have to make the code only using the printf("*"); printf(" "); printf("/n"); statements once. I want to accomplish this with a for loops and if statements.
It is supposed to look like this:
* - 5 spaces before *
* * - 4 spaces before *
* * * - 3 spaces before *
* * * * * * - 0 spaces before *
This is what I've tried so far:
main()
{
int i, j, k;
i=1;
j=1;
[Code]....
here are the links on codepad [URL]
I think my first approach is way off. But I think I am on to something in the second link. I'm trying to print the "*" and extra 2 times on the fourth line. In the second link the compiler appears to be ignoring the || operator. Is my syntax incorrect in the second attempt? How should I change my if statement to make this pattern work?
View 2 Replies
View Related
Apr 21, 2013
Write a for loop statement to print the numbers from 1 to 10 in reverse order separated by star :
10*9*8*7*6*5*4*3*2*1
i try to do it but it show me like this :
10*9*8*7*6*5*4*3*2*1*
how do i write to show me like the first one ?
View 10 Replies
View Related
Nov 16, 2013
I am fairly new to c++, and I want to be able to draw a polygon. When I have searched for how to draw one, the only thing i can find is scripts doing things like this:
*
**
***
****
*****
I doubt that c++ is that primitive, and I'm looking for something like the c++ equivalent of this python script:
Syntax: draw.polygon((20,20)(30,30)(50,30)(20,40)(20,20), fill(green))
I am using a mac os 10.9
View 2 Replies
View Related
Aug 20, 2013
I'm trying to create a grid using the following characters: !, @, #, $, &.
It's an 8 x 8 grid, and should contain the characters in no particular order (trying to create a Bejeweled-like game).
I already defined the width and length to be 8, so:
#define WIDTH 8
#define LENGTH 8
Code:
void makegrid(char grid[])
{
int j;
int k;
for ( j = -1; j < LENGTH; j++ )
{
for ( k = -1; k < WIDTH; k++ )
{
/* I don't know what to type here anymore :( */
}
} }
View 14 Replies
View Related
Jun 22, 2014
This is my first time using opengl and I am experimenting with adding/drawing polygons/points/etc. on top of a PPM image. The image is already loaded when the application runs. My attempt to draw a square is from lines 30 - 35. The program runs but the square is not present. Just the image.
#include<windows.h>
#include <stdio.h>
#include <stdlib.h>
#include<Gl/gl.h>
#include<GL/glut.h>
int n;
int m;
int *image;
[Code] ....
View 5 Replies
View Related
Jan 3, 2014
i want to draw a 3D snake in opengl.. i can't get nothing out of my search to make a start.. how it is made
View 4 Replies
View Related
Nov 8, 2014
I want to write a function called DrawLineSegments.This function must change the color of lines at every corner where the corner angle is greater than 60 deg (Assume that there is a function called checkangle). The color sequence must be black, red, green, blue, and repeat this sequence after the fourth color.
View 1 Replies
View Related
Nov 26, 2013
I want to draw a 2D bar chart according to 10 or 15 numbers in c++. How can i do it? Which i need components?
View 1 Replies
View Related
Jul 11, 2013
I want to draw a magnifying glass using graphics.h which is used mostly as "Search" icon. But, I am having problems in making the rectangle attached to the two circles (one inscribed on another) . I have also included the screenshot (made in powerpoint) on how the output will look like, enen I've made most of the part, except the search icon (magnifying glass).
The Link for the screenshot is : [URL] ....
View 3 Replies
View Related
Apr 11, 2014
How can I draw thus shape using loop for
0
0 1
0 1 2
0 1 2 3
0 1 2 3 4
0 1 2 3 4 5
Also this shape
1*****
12****
123***
1234**
12345*
123456
View 6 Replies
View Related
Jul 8, 2014
I used the following code. I called a method named lets_draw
private void lets_draw() {
int i,z;
z = 40;
Line[] line = new Line[20];
for(i=1;i<=10;i++) {
[Code] ....
But it showed the following message
"An unhandled exception of type 'System.NullReferenceException' occurred in SkeletalTracking.exe
Additional information: Object reference not set to an instance of an object."
View 1 Replies
View Related
Jan 5, 2015
Let's say there are three slots in my array (3 pieces of hardware to be used). If one worker comes in, it takes an instrument, and I tag it as used on random basis. Next, the next worker comes in, it takes another unused instrument randomly and so on. When the first worker finishes using that instrument, he returns it back to the inventory. How should I write such code in C++?
View 8 Replies
View Related
Mar 27, 2014
Im new to c#. In c++ I have made a window and painted it with dots and concentric circles, like a radar PPI screen. Trying to do this in c#, I can't find how to draw a single pixel on the window.
Also, what should I be drawing on: the form, panel, picturebox...?
View 2 Replies
View Related
Feb 4, 2014
Draw the total of a passed value, or value in general, without checking how many values there are individually.
Here's a pseudo-example:
int aliens = 10; // This should be changed as desired.
void drawaliens(int value) {
aliens.draw(value); // Instead of having a test of how many to draw, draw the amount there is from one check
}
I want to draw the amount of aliens passed or called to the alien draw function.
However, I don't want the function to check every possible value of aliens which could be passed before drawing, and just check the value once and draw that value.
IF x ALIENS, DRAW x ALIENS instead of...
IF 1 ALIEN, DRAW ALIEN(1);
IF 2 ALIEN, DRAW ALIEN(2);
IF 3 ALIEN, DRAW ALIEN(3);
.... and so on.
If there can be hundreds of aliens, it seems impractical to check every single possible value before drawing, and just check the value and draw that value.
View 2 Replies
View Related
Apr 24, 2014
Ive been experimenting with 3d graphics by using SDL only and lines to draw 3d shapes (no OpenGL or extension libraries, just pure math),
Ive used this page mainly to guide me on perspective projection but i have no luck [URL] ....
Ive been trying to draw a cube, but instead it gives me a mirrored dual triangular pyramids
This code here rotates the object as seen from the equations in this link: [URL] ....
double aX, aY, aZ;
for ( i = 0; i < model->qLength; i++ ) {
for ( j = 0; j < 4; j++ ) {
aX = model->quadArr[i].pointArr[j].x;
aY = model->quadArr[i].pointArr[j].y;
aZ = model->quadArr[i].pointArr[j].z;
[Code] .....
generally, i project it onto a 2d plane using: [URL] .....
double dx, dy, dz, dX, dY, dZ;
int bx, by, bX, bY;
for ( i = 0; i < model->qLength; i++ ) {
for ( j = 0; j < 4; j++ ) {
[Code] .....
I understand that my code is very messy and unoptimized, but im just concentrating on getting the core concepts to work with my code
View 1 Replies
View Related
Sep 7, 2014
I have a question about SDL and drawing sprites (SDL surfaces). My idea is that the user can create a wall of separate sprites by create one sprite each time in the current mouseX and mouseY position, when the user push down the e-key. The problem is that I have no idea how I could draw the same sprite multiple times without to delete the previous one.
View 3 Replies
View Related
Mar 21, 2014
I am trying to draw a 2d grid array for a battleships game. I need the grid to have a border around each cell, how to do this. so far my code is:
#include<iostream>
using namespace std;
int main(){
int grid[5][5] = {{0}};
[Code] .....
View 4 Replies
View Related
Mar 20, 2014
I'm trying to draw a 5x5 grid for a battleships game.
How to draw the grid with borders and individual cells.
I'm using dev c++
View 14 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
Jul 5, 2013
Write a program using turbo c to draw a rectangle inside a circle..........
View 2 Replies
View Related
Nov 19, 2012
Got buffer with raw data. How to display it in MFC dialog and refresh it?
View 3 Replies
View Related