Skip to main content

Questions tagged [draw]

The tag has no usage guidance.

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

How to detect collision of a sprite with objects drawn by pen within a single sprite?

In Scratch, there is a boolean expression called "touching" and it can be used on one sprite to detect when it hits another sprite. But what if I want to detect when a sprite hits objects (...
Hamed's user avatar
  • 3
0 votes
1 answer
154 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, ...
Bora Özenbirkan's user avatar
0 votes
1 answer
47 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 ...
Ana Viktoriv's user avatar
0 votes
1 answer
39 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 ...
DCBuilder's user avatar
0 votes
1 answer
25 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 ;...
Quasar's user avatar
  • 1
1 vote
1 answer
46 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 ...
Alex Durante's user avatar
0 votes
1 answer
39 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 ...
ffelix's user avatar
  • 1
0 votes
1 answer
110 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 ...
Mynah's user avatar
  • 40
0 votes
1 answer
53 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: ...
Andy Stevens's user avatar
0 votes
1 answer
78 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 ...
DryHeeves's user avatar
0 votes
1 answer
71 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(...
Sarabjot Singh's user avatar
0 votes
2 answers
42 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.
YASHI KHATRI's user avatar
0 votes
1 answer
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 ...
Petar Petrov's user avatar
0 votes
1 answer
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 -...
Dhawal Patel's user avatar
0 votes
2 answers
132 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++) ...
SnezhinaT's user avatar
0 votes
2 answers
655 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; ...
Iris Frenzy's user avatar
0 votes
1 answer
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 ...
klmo8's user avatar
  • 25
-2 votes
2 answers
854 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 ...
shutdown23's user avatar
-1 votes
1 answer
278 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) -...
Bouchra Khatab's user avatar
0 votes
2 answers
512 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 ...
Yao Li's user avatar
  • 33
2 votes
2 answers
267 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 ...
Andrew Gray's user avatar