User Tools

Site Tools


Sidebar

projects

pct0 (bonus; due 20230823)
wcp1 (due 20230823)
abc0 (due 20230830)
pct1 (bonus; due 20230830)
pct2 (due 20230830)
wcp2 (due 20230830)
dac0 (due 20230906)
pct3 (bonus; due 20230906)
wcp3 (due 20230906)
gtf0 (due 20230913)
pct4 (due 20230913)
wcp4 (due 20230913)
pct5 (bonus; due 20230920)
tpb0 (due 20230920)
wcp5 (due 20230920)
gfo0 (due 20230927)
pct6 (due 20230927)
tpb1 (due 20230927)
wcp6 (due 20230927)
pct7 (bonus; due 20231004)
tpb2 (due 20231004)
wcp7 (due 20231004)
bwp1 (bonus; due 20231018)
pct8 (due 20231018)
usr0 (due 20231018)
wcp8 (due 20231018)
fwg0 (due 20231025)
pct9 (bonus; due 20231025)
wcp9 (due 20231025)
gfo1 (due 20231101)
pctA (due 20231101)
upf0 (due 20231101)
wcpA (due 20231101)
pctB (bonus; due 20231108)
usf0 (due 20231108)
wcpB (due 20231108)
ldg0 (due 20231115)
pctC (due 20231115)
wcpC (due 20231115)
bwp2 (bonus; due 20231129)
pctD (bonus; due 20231129)
wcpD (bonus; due 20231129)
gfo2 (due 20231206)
pctE (bonus; due 20231206)
wcpE (bonus; due 20231206)
EoCE (due 20231214)
haas:fall2023:unix:projects:gtf0

Corning Community College

CSCS1730 UNIX/Linux Fundamentals

PROJECT: Graphics To Figure-out (GTF0)

OBJECTIVE

As we are still early in our journey, despite not yet having learned much, let us see how our observational and pattern-matching and problem solving skills can still yield productive changes toward the solution of a task.

TASK

You are to modify provided code, once functionality and operations of it are understood, to produce, as image output, a scene containing the following characteristics:

  • confined within a square resolution of at least 1000×1000 pixels
  • contain at least:
    • 1 filled rectangle, no shorter than 32 pixels on any side
    • 1 unfilled rectangle, no shorter than 64 pixels on any side
    • 1 circle, diameter no smaller than 128 pixels
    • 1 ellipse
    • utilize at least 8 uniquely mixed colors
    • NOTE: background not a substitute for required filled rectangle above
  • annotate your image with your initials, ideally in some corner

EDIT

You will want to go here to edit and fill in the various sections of the document:

GTF0

GRABIT

grabit unix gtf0

REPOSITORY STEPS

Use the “hg add” command after you grab the project to add it to the repository.

Then use the “hg commit -m ”(message here)“” command to let yourself know any changes you made before adding it to your repository.

Then use the “hg push” command to finalize adding the file with the commit message.

On a different system, you can use “hg pull” and “hg update” to update your changes on different systems, allowing you to save and load your work on lab 46 or on your personal system.

RUN THE PROGRAM

To use the gtf0.c program you do not need to compile it. Once you have edited and changed the code with a text editor and saved it, you can run ./gtf0.c to run it.

Afterwards you can use the mv command to move it to public_html.

It can be helpful to have a second terminal and a window showing your gtf0.png picture so that you can see your changes more quickly. Have your open .c file on one terminal, use the other terminal to run your .c file and to move the resulting .png file to public_html, and the window showing your picture so you can refresh it to see changes.

VIEW THE IMAGE

To view your picture you go into your file explorer where you put your Unix file and find the “gtf0.png” and then click on it to view your image.

You can also view it in a web browser at https://lab46.g7n.org/~username/gtf0.png

LIBGD FUNCTIONALITY

MIXING A COLOR

You can make a color by declaring a new variable int colorName = 0; and then defining it like colorName = gdImageColor (image, 0x??, 0x??, 0x??);. The 0x?? is the amount of red, green, and blue (respectively) that is in your color. The 0x?? format is hexidecimal so the highest amount of each color would be 0xFF and the lowest would be 0x00.

DRAWING A LINE

A line can be drawn with the command gdImageLine (image, x, y, x2, y2, color);. x and y are the starting x and y positions, x2 and y2 are the ending x and y positions and color is which color you want it to be.

DRAWING A RECTANGLE

gdImageRectangle (image, x, y, x2, y2, color);

FILLING AN ENCLOSED SPACE

gdImageFill (image, x, y, color);

DRAWING A FILLED RECTANGLE

gdImageFilledRectangle (image, x, y, x2, y2, color);

DRAWING A CIRCLE

gdImageArc (image, center x, center y, width, height, 360, 360, color);

In order to make a perfect circle, you should ensure that the width and height are the same.

DRAWING AN ELLIPSE

An ellipse is much like a circle, but the main difference is that where a circle has an equal diameter for both the x and y axis, an ellipse will have different diameters. To draw, use the same function used for drawing circles gdImageArc (image, center x, center y, x diameter, y diameter, angle start, angle end, color). Understand that when the machine is drawing the arc, the line of the arc itself is half the distance of the diameter from the center. In other words, the diameter inputs refer to the measurement from end to end of the arc horizontally and vertically once fully drawn. An easy way to produce an ellipse is to double the integer of just one diameter input. This will stretch it out in the direction you choose in the function.

 

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

  • Project must be submit on time, by the deadline.
    • Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
  • All code must run cleanly (no warnings or errors)
    • all requested functionality must conform to stated requirements (either on this document or in a comment banner in source code files themselves).
  • Executed programs must display in a manner similar to provided output
    • output formatted, where applicable, must match that of project requirements
  • Processing must be correct based on input given and output requested
  • Output, if applicable, must be correct based on values input
  • Code must be nicely and consistently indented
  • Code must be consistently written, to strive for readability from having a consistent style throughout
  • Code must be commented
    • Any “to be implemented” comments MUST be removed
      • these “to be implemented” comments, if still present at evaluation time, will result in points being deducted.
      • Sufficient comments explaining the point of provided logic MUST be present
  • Track/version the source code in your lab46 semester repository
  • Submit a copy of your source code to me using the submit tool

Submit Tool Usage

Let's say you have completed work on the project, and are ready to submit, you would do the following:

lab46:~/src/SEMESTER/DESIG/PROJECT$ submit DESIG PROJECT file1 file2 file3 ... fileN

You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.

RUBRIC

I'll be evaluating the project based on the following criteria:

26:gtf0:final tally of results (26/26)
*:gtf0:modified code appropriately to accomplish task [16/16]
*:gtf0:commented code adequately to describe process [8/8]
*:gtf0:removed unused code [2/2]

Pertaining to the collaborative authoring of project documentation

  • each class member is to participate in the contribution of relevant information and formatting of the documentation
    • minimal member contributions consist of:
      • near the class average edits (a value of at least four productive edits)
      • near the average class content change average (a value of at least 256 bytes (absolute value of data content change))
      • near the class total content contribution average (a value of at least 1kiB)
      • no zero-sum commits (adding in one commit then later removing in its entirety for the sake of satisfying edit requirements)
    • adding and formatting data in an organized fashion, aiming to create an informative and readable document that anyone in the class can reference
    • content contributions will be factored into a documentation coefficient, a value multiplied against your actual project submission to influence the end result:
      • no contributions, co-efficient is 0.50
      • less than minimum contributions is 0.75
      • met minimum contribution threshold is 1.00

Additionally

  • Solutions not abiding by spirit of project will be subject to a 50% overall deduction
  • Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
  • Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
  • Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction
haas/fall2023/unix/projects/gtf0.txt · Last modified: 2023/08/28 14:53 by 127.0.0.1