Thread: Need help with programming homework. Has to do with making a dot bounce diagonally

  1. #1
    Registered User
    Join Date
    Mar 2018
    Posts
    1

    Need help with programming homework. Has to do with making a dot bounce diagonally

    So I need the dot to bounce from the upper left corner to the bottom and to the upper right corner here is the code I have so far which just lets the dot appear. Also I am in Pico


    [ Read 23 lines ]
    UW PICO 5.09 File: Cdineen_HW3.c

    Code:
    //dot/circle bouncing back and forth
    // 3/29/18
    
    
    #include <stdio.h>
    #include "philsplot.h"
    
    
    int main() {
     double x1=-10., x2=+10., y1=-7., y2=+7.;
     open_plot("1000x700");
     setlim_plot(x1,x2,y1,y2);
     double expand=4.0;
     int pColor=2,pVertex=10,pStyle=1,pMem=1;
     double x=0., y=0.;
     delay_plot(3000);
     putpoint_plot(x,y,pVertex,pStyle,pColor,expand,pMem);
     flush_plot();
    delay_plot(3000);
    delpoint_plot();
    flush_plot();
     printf("Press Enter");
     getchar();
     close_plot();
    }

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,115
    Where is the rest of the code?

    "philsplot.h"
    "philsplot.c" ???

    How can we answer your question without knowing more.

    Also, you source code formatting needs to be improved. Pick a style at the URL below and stick to it!

    Indentation style - Wikipedia

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Found a like to another program using PhilsPlot; which some professor created. Likely an Prof. at arizona.edu.
    http://www.physics.arizona.edu/~doug/sine_plot.c

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to reflect a square matrix diagonally?
    By keivi in forum C Programming
    Replies: 5
    Last Post: 06-10-2013, 04:37 PM
  2. Replies: 4
    Last Post: 10-10-2012, 11:53 PM
  3. Printing diagonally in an array
    By 843 in forum C Programming
    Replies: 3
    Last Post: 11-10-2010, 01:45 PM
  4. Checking connect 5 diagonally help
    By Rob4226 in forum C Programming
    Replies: 2
    Last Post: 09-04-2009, 03:28 PM
  5. need help making a dot bounce up and down y axis in this prog
    By redwing26 in forum Game Programming
    Replies: 10
    Last Post: 08-05-2006, 12:48 PM

Tags for this Thread