Shared Flashcard Set

Details

Arcade Definitions
Important Terms
56
Computer Science
Beginner
05/08/2021

Additional Computer Science Flashcards

 


 

Cards

Term
What Three parameters does open_window require.
Definition
The window width in pixels.

The window height in pixels.

The text that will appear on the title bar.
arcade.open_window(600,600,'Drawing Example')
Term
How to comment code
Definition
with a hash mark # or
with three single quotes or double quotes
''' Comment''' or """Comment""" Three quotes allow for multiline comments
Term
importing
Definition
you can import a library by using the import command
import arcade or
from arcade import * The star means import all.
Term
function
Definition
A means by which we give the computer commands print('Hello') is the print function. We can define functions
Term
statement
Definition
A line of code in Python. It includes the function name, parentheses, numbers, text and everything else required to call the function or perform some other operation.
Term
Application Program Interface or “API”
Definition
The names of the functions, the order of the parameters
Term
start_render, finish_render
Definition
These commands tell the Arcade library when you are about to start drawing (start_render), and when you are done drawing (finish_render).
Term
methods for drawing color
Definition
arcade.csscolor.SKY_BLUE
arcade.color.AQUAMARINE
arcade.color(255,255,255) RGB
Term
What base does a computer use and an example of a byte
Definition
base 2
8 bits 1111
Term
How many colors can a 32 bit computer display
Definition
4,294,967,296
Term
drawing primitives
Definition
drawing of circles, ellipse, triangles, rectangles and polygons
Term
code for drawing primitives
Definition
draw_rectangle_filed
# Tree trunk
# Center of 100, 320
# Width of 20
# Height of 60 the code is
arcade.draw_rectangle_filled(100,320,20,60,arcade.csscolor.SIENNA
Term
to draw a circle
Definition
you need the x coordinate, y coordinate, center, and color
arcade_draw_circle_filled(200,100,60,(250,250,250)
Term
To draw an ellispe
Definition
# Draw an ellipse and rect with
# a center of (300, 300)
# width of 350
# height of 200
arcade.draw_rectangle_outline(300, 300, 350, 200, arcade.csscolor.BLACK, 3)
arcade.draw_ellipse_outline(300, 300, 350, 200, arcade.csscolor.RED, 3)
Term
To Draw an Arc
Definition
# Another tree, with a trunk and arc for top
# Arc is centered at (300, 340) with a width of 60 and height of 100.
# The starting angle is 0, and ending angle is 180.
arcade.draw_rectangle_filled(300, 320, 20, 60, arcade.csscolor.SIENNA)
arcade.draw_arc_filled(300, 340, 60, 100, arcade.csscolor.DARK_GREEN, 0, 180)
Term
Triangle
Definition
# Another tree, with a trunk and triangle for top
# Triangle is made of these three points:
# (400, 400), (370, 320), (430, 320)
arcade.draw_rectangle_filled(400, 320, 20, 60, arcade.csscolor.SIENNA)
arcade.draw_triangle_filled(400, 400, 370, 320, 430, 320, arcade.csscolor.DARK_GREEN)
Term
Draw a polygon
Definition
# Draw a tree using a polygon with a list of points
arcade.draw_rectangle_filled(500, 320, 20, 60, arcade.csscolor.SIENNA)
arcade.draw_polygon_filled(((500, 400),
(480, 360),
(470, 320),
(530, 320),
(520, 360)
),
arcade.csscolor.DARK_GREEN)
Term
To draw a line
Definition
start point, end point, color and optional line thickness.
arcade.draw_line(500, 550, 400, 550, arcade.color.YELLOW, 3)
Term
To draw text
Definition
The text to draw is the first parameter. The x, y location of the text is are next two. Finally the color and font size come next.
# Draw text at (150, 230) with a font size of 24 pts.
arcade.draw_text("Arbor Day - Plant a Tree!",
150, 230,
arcade.color.BLACK, 24)
Term
parameter names
Definition
Make it easier to identify what is defined
arcade.draw_arc_outline(center_x=300,
center_y=340,
width=60,
height=100,
color=arcade.csscolor.BLACK,
start_angle=0,
end_angle=180,
border_width=3,
tilt_angle=45)
Term
module
Definition
a module is a file consisting of Python code. A module can define functions, classes and variables. A module can also include runnable code.
Term
statement
Definition
a line of code in Python which includes the function name, parentheses, numbers, text and everything else required perform an operation?
Term
labray name and function name are separated by a
Definition
period
Term
PEP-8 says that we should
Definition
Put a space after a comma.
Term
What function do we use to open a window
Definition
arcade.open_window(600, 600, "Drawing Example")
Term
What do we call the names of the functions and parameter order that make up how we interface with a library?
Definition
Application Program Interface or “API” for short
Term
How do we set the background color
Definition
arcade.set_background_color(arcade.csscolor.SKY_BLUE)
Term
What function name must happen before you start drawing?
Definition
arcade.start_render()
Term
What function name happens after drawing?
Definition
arcade.finish_render()
Term
to keep a program running
Definition
arcade.run()
Term
Colors are specified using three numbers that represent what?
Definition
RGB
Term
If a color is turned all the way OFF, what number is used?

If a color is turned all the way ON, what number is used?
Definition
0 color is off
255 color is all the way on
Term
A bit can hold what two numbers?
Definition
0,1
Term
A byte is made up of how many bits?
Definition
8
Term
A byte can hold how many different combinations of numbers?
Definition
a byte is a bits and can hold 2^8 or 256 colors.
Term
What do we call the main “brain” of the computer where all the processing happens?
Definition
CPU or Central Processing Unit
Term
Instructions for a CPU are made up of a long sequence of what?
Definition
0 and 1
Term
What is the name of the native language for CPUs?
Definition
Machine Code
Term
What is the difference between a CPU and a GPU?
Definition
The GPU is a processor whose primary purpose is to run graphics displays.
Term
Commands with a GPU can be processed by hundreds or thousands of what?
Definition
Cores
Term
If machine language is a first-generation language, what is the second-generation language?
Definition
Assembly
Term
What do we call the file that programmers type commands into?
Definition
Command line interface
Term
What is the name of the program that turns assembly language into machine language?
Definition
A compiler turns human-readable code into machine code.
Term
Third-generation languages usually fall into what three categories?
Definition
Compiled, Interpreted, Runtime Environment
Term
Compiled
Definition
The computer takes the original source code, and uses a compiler to translate it to machine code. The user then run the machine code. The original source code is not needed to run the program. “C” is an example of a language that works this way. So is the 2GL assembly language we just talked about.
Term
Interpreted
Definition
The computer looks at the source code and translates/runs it line-by-line. The compile step is not needed, but the user needs both the source code and an interpreter to run the program. Python is an example of an interpreted language.
Term
Runtime Environment
Definition
Languages such as Java and C# take source code, and compile the source code to a machine language. But not the language of your actual machine, they compile to a virtual machine. This is a separate program that acts as a layer between the real machine and the compiled code. This allows for better security, portability, and memory management.
Term
What is the difference between a compiler and an interpreter
Definition
Interpreter translates just one statement of the program at a time into machine code.
Compiler scans the entire program and translates the whole of it into machine code at once.
Term
What generation of language is Python?
Definition
3rd generation
Term
What are some of the most popular languages in use today, according to the TIOBE Index?
Definition
Python, Java, C, C#, Ruby
Term
*, /, +, -, **, //, %
Definition
multiplication, division, add, subtract, power, integer division, modulus(gives remainder)
Term
integer division // takes a number and divides it by another and returns and integer rounding down
Definition
7//2=3
Term
What is the code to add 1 to x? (That is, actually change the value of x.)
Definition
x = x + 1 or x+=1
Term
Give an example of printing a variable, including additional text that labels what it is.
Definition
r = 3
print ("r = " + str(r)
Term
python library
Definition
A Python library is a reusable chunk of code that you may want to include in your programs/ projects
Term
expression
Definition
an equation
Supporting users have an ad free experience!