Questions tagged [draw]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
46 views

GD50 - Breakout | Bad Argument #2 (Quad expected, got nill)

This problem is about adding a new Powerup feature to the Breakout game. I literally did what Colton did. The things what I did; "GenerateQuadsPowerups" function in Util, A new Powerup class, ...
0
votes
1answer
40 views

game of fifteen problem with initialisation of my 2D array

I have been working on this program more than a week and even started once again from the beginning. I created init() function and draw() function in a separate file (they both are in main function ...
0
votes
1answer
35 views

Game of Fifteen Draw function outputting only zeros

I am currently trying to solve a bug that prevents me from printing my wanted values. When I initialize the board and try to assign the value it appears to assign only zeros from the for loops even ...
0
votes
1answer
18 views

The output is only _

So in this program, the only output I am getting is _. Help would be appreciated. My init: void init(void) { // Initializing the game int square; square = (d*d) - 1; for (int i = 0 ;...
1
vote
1answer
42 views

Game of Fifteen Not Swapping Tiles and Allowing Illegal Movies

I have two issues with my code. First, while the code correctly moves the underscore to the new space, it does not move the tile to the space where the underscore once was. So I end up with a bunch of ...
0
votes
1answer
32 views

pset3 'fifteen' - init function only works for small grids

My init() code works beautifully for grids of 3, 4, or 5, but chokes with larger grid of 6, 7, 8, and 9. It looks almost like an integer overflow or floating point imprecision problem, but I can't see ...
0
votes
1answer
107 views

pset3 - swap in function Init

I've been working on Game of Fifteen in Pset3 and I'm having a hard time understanding why I can't seem to find a way to swap the last 2 elements in the Init() function if the dimensions of the board ...
0
votes
1answer
48 views

Fifteen move questions

http://pastebin.com/NJ7XmqcR I've worked on pset3 today and and have come stuck with a few errors that i can't seem to figure out. Any help is greatly appreciated fifteen.c:223:41: error: ...
0
votes
1answer
76 views

Problem Set 3 Fifteen - Draw function drawing more than it should

I've been working on pset3 game of fifteen in cs50 and when working on the draw function, the first output is exactly how it should be. However, if I restart the game by entering zero, then compiling ...
0
votes
1answer
65 views

pset3, move function !! Please Help?

This code swaps digits but when i enter illegal key instead of illegal key prompt it replaces that digit with 0. bool move(int tile) { int blank; for(int i=0; i<d; i++) { for(...
0
votes
2answers
39 views

draw() function not working, it gives no output

this is my code [spoiler code hidden behind edit flag] my code is not giving any output.I don't understand where i have gone wrong, so please can you help me.
0
votes
1answer
1k views

pset3: fifteen - “init” and “draw”

So I've written the code for two of the functions in "fifteen", but after I compiled and started the program it prints a bunch of zeros. I'm hoping for a tip from you guys. The code for the two ...
0
votes
1answer
66 views

PSet 3 - Game of fifteen - draw tile gives weird output

I have not been able to draw the board properly. Whenever i run the code ~/workspace/pset3/fifteen/ $ ./fifteen 4 WELCOME TO GAME OF FIFTEEN 15 14 13 12 11 0 0 4196528 0 0 -186283616 32766 48 -...
0
votes
2answers
131 views

init and draw not working properly in pset3 fifteen

I can not find my mistake, but there is something wrong obviously either with init or with draw: My code for init is: void init(void) { if (d%2 != 0) { for (int i = 0; i < d; i++) ...
0
votes
2answers
639 views

Pset3 Fifteen: Draw and/or Init Function Problem

I cannot figure out why this code is not working. The output appears to be random. Any help is greatly appreciated. Thanks! My Init code: void init(void) { int MAX = (d*d)-1; int below = 0; ...
0
votes
1answer
322 views

Pset3: draw() is printing out incorrectly

I've tested my init() and draw() together in a separate file, and it works exactly as it should. However, when I try implementing these functions within the fifteen distribution code, draw() prints ...
-2
votes
2answers
840 views

How to set up the board using init and draw functions

I am working on PSET3 Fifteen and am really unsure of what I am doing with the init function. I have a nested for loop – but I don't know what to do with the values. I then move on down to draw and I ...
-1
votes
1answer
258 views

In fifteen.c how do I print the current state of the board in draw()?

I don't understand how I can print the current state of the board in draw(). This is my code: for (int i = 0; i < d; i++) { for (int j = 0; j < d; j++) { board[i][j] = (d * d) -...
0
votes
2answers
499 views

How to pass grid values to draw in pset3

I've just finished coding init and have started draw but I'm not sure how to pass on my grid values to the draw functions. Especially as the values may change as the user plays the game. I've tried to ...
2
votes
2answers
264 views

Why Aren't My Last Two Tiles Swapping?

I'm trying to come up with something to change the tile numbers in the last two array slots, containing numbers 1 and 2 when I have an odd number of tiles. I thought this would work, but when I print ...