Sunteți pe pagina 1din 46

Unit 3

// Prepare Turtle to Draw

hide();

penUp();

// First draw the background

drawBackground(1000);

moveTo(120, 200);

drawFish(30, 250, 125, 0);

moveTo(150, 300);

drawStarfish(randomNumber(0, 320));

moveTo(250, 450);

drawSeagrass(randomNumber(0, 320));

moveTo(150,400);

// Draw all the starfish

drawStarfish(randomNumber(0, 320));

// Draw all the seagrass on bottom of screen

moveTo(50,450);

turnTo(0);

drawSeagrass(randomNumber(0, 320));

// Draw all the fish

moveTo(100,100);

drawFish(30, 250, 125, 0);


// Make the background by drawing a large dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five pointed star with a wide pen.

function drawStarfish(){

// Setting up the pen

penRGB(255,0,255);

penWidth(20);

penDown();

turnTo(0);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

penUp();

}
// Switches between left and right arcs to make sea grass

function drawSeagrass(){

// Setting up the pen

penRGB(0,255,0);

penWidth(10);

penDown();

// Draw four arcs to make grass

arcLeft(30,100);

arcRight(60,100);

arcLeft(60,100);

arcRight(60,100);

penUp();

// Draw a single fish at current turtle location

function drawFish(){

// Setting up the pen

penRGB(250,125,0);

penWidth(30);

penDown();

// Fish body

dot(30);

turnTo(90);
moveForward(30);

// Fish tail

turnLeft(30);

moveForward(30);

turnRight(120);

moveForward(30);

turnRight(120);

moveForward(30);

turnRight(120);

penUp();

//15

// Prepare Turtle to Draw

hide();

penUp();

// First draw the background

drawBackground(1000);

moveTo(120, 200);

drawFish(30, 250, 125, 0);

moveTo(150, 300);

drawStarfish(randomNumber(0, 320));

moveTo(250, 450);

drawSeagrass(randomNumber(0, 320));
moveTo(150,400);

// Draw all the starfish

drawStarfish(randomNumber(0, 320));

// Draw all the seagrass on bottom of screen

moveTo(50,450);

turnTo(0);

drawSeagrass(randomNumber(0, 320));

// Draw all the fish

moveTo(100,100);

drawFish(30, 250, 125, 0);

// Make the background by drawing a large dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five pointed star with a wide pen.

function drawStarfish(){

// Setting up the pen

penRGB(255,0,255);

penWidth(20);

penDown();
turnTo(0);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

penUp();

// Switches between left and right arcs to make sea grass

function drawSeagrass(){

// Setting up the pen

penRGB(0,255,0);

penWidth(10);

penDown();

// Draw four arcs to make grass

arcLeft(30,100);

arcRight(60,100);

arcLeft(60,100);

arcRight(60,100);
penUp();

// Draw a single fish at current turtle location

function drawFish(){

// Setting up the pen

penRGB(250,125,0);

penWidth(30);

penDown();

// Fish body

dot(30);

turnTo(90);

moveForward(30);

// Fish tail

turnLeft(30);

moveForward(30);

turnRight(120);

moveForward(30);

turnRight(120);

moveForward(30);

turnRight(120);

penUp();

//16
// Prepare Turtle to Draw

hide();

penUp();

// First draw the background

drawBackground(1000);

moveTo(120, 200);

drawFish(30, 250, 125, 0);

moveTo(150, 300);

drawStarfish(randomNumber(0, 320));

moveTo(250, 450);

drawSeagrass(randomNumber(0, 320));

moveTo(150,400);

// Draw all the starfish

drawStarfish(randomNumber(0, 320));

// Draw all the seagrass on bottom of screen

moveTo(50,450);

turnTo(0);

drawSeagrass(randomNumber(0, 320));

// Draw all the fish

moveTo(100,100);

drawFish(30, 250, 125, 0);


// Make the background by drawing a large dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five pointed star with a wide pen.

function drawStarfish(){

// Setting up the pen

penRGB(255,0,255);

penWidth(20);

penDown();

turnTo(0);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

moveForward(60);

turnRight(144);

penUp();

}
// Switches between left and right arcs to make sea grass

function drawSeagrass(){

// Setting up the pen

penRGB(0,255,0);

penWidth(10);

penDown();

// Draw four arcs to make grass

arcLeft(30,100);

arcRight(60,100);

arcLeft(60,100);

arcRight(60,100);

penUp();

// Draw a single fish at current turtle location

function drawFish(){

// Setting up the pen

penRGB(250,125,0);

penWidth(30);

penDown();

// Fish body

dot(30);

turnTo(90);

moveForward(30);
// Fish tail

turnLeft(30);

moveForward(30);

turnRight(120);

moveForward(30);

turnRight(120);

moveForward(30);

turnRight(120);

penUp();

//20

Functiile incapsuleaza prelucrari bine precizate si pot fi reutilizate in mai multe programe.

Unit 9

//4

// Insert your code here

for (var i = 0; i < 72; i++) {

drawSquare(100);

turnRight(10);

//5

Codul de mai sus deseneaza 100 de puncte de ferite culori.

//6

penUp();

for (var i = 0; i < 3000; i++) {

penRGB(randomNumber(0,255), randomNumber(0,255), randomNumber(0,255), 0.5);

moveTo(randomNumber(0,320), randomNumber(0,450));
dot(randomNumber(1,20));

for (var i = 0; i < 400000; i++) {

penRGB(250, 250, 250, 0.5);

moveTo(randomNumber(0,320), randomNumber(0,450));

dot(10);

//7

penUp();

for (var i = 0; i < 3000; i++) {

penRGB(randomNumber(0,255), randomNumber(0,255), randomNumber(0,255), 0.5);

moveTo(randomNumber(0,320), randomNumber(0,450));

dot(randomNumber(1,20));

for (var i = 0; i < 400000; i++) {

penRGB(250, 250, 250, 0.5);

moveTo(randomNumber(0,320), randomNumber(0,450));

dot(10);

//8

// Prepare Turtle to Draw

hide();

penUp();

// These six functions draw everything. Order matters

// for how different parts of the picture are layered.

drawBackground();
drawAllSeagrass();

drawAllSeaStars();

drawAllFish();

drawAllBubbles();

drawAllSunbeams();

// To do: Repeatedly draw sea grass

function drawAllSeagrass(){

for (var i = 0; i < 20; i++) {

moveTo(randomNumber(0,320),450);

turnTo(0);

drawSeagrass(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw sea stars

function drawAllSeaStars(){

for (var i = 0; i < 30; i++) {

moveTo(randomNumber(0,320), 450);

turnTo(0);

drawSeaStar(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw fish

function drawAllFish(){

for (var i = 0; i < 3; i++) {


moveTo(randomNumber(0,120),randomNumber(0,400));

drawFish(randomNumber(5,20),randomNumber(100,255),randomNumber(100,150),120);

// To do: Repeatedly draw bubbles

function drawAllBubbles(){

for (var i = 0; i < 80; i++) {

moveTo(randomNumber(0,360),randomNumber(0,450));

drawBubble(randomNumber(1,40));

// To do: Repeatedly draw sunbeams

function drawAllSunbeams(){

for (var i = 0; i < 60; i++) {

moveTo(randomNumber(-50,120),0);

turnTo(randomNumber(165,175));

drawSunbeam(randomNumber(100,400));

// Make the background by drawing a large blue dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

}
// Draw a five-pointed star with a wide pen of the given size

function drawSeaStar(size){

for (var i = 0; i < 10; i++) {

penRGB(255,0,255);

penWidth(10);

penDown();

turnTo(0);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

penUp();

// Switches between left and right arcs to make seaGrass with the given radius

function drawSeagrass(radius,numWaves){

penRGB(0,randomNumber(100,200),0);
penWidth(3);

penDown();

arcLeft(30,radius);

// Repeatedly switch between left and right

for(var i = 0; i < numWaves; i++){

arcRight(60,radius);

arcLeft(60,radius);

penUp();

// Draws a fish at the current turtle location with the given size and color

function drawFish(size, red, green, blue){

penRGB(red,green,blue);

penWidth(size);

penDown();

// Fish body

dot(size);

turnTo(90);

moveForward(size);

// Fish tail

turnLeft(30);

moveForward(size);

turnRight(120);
moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

penUp();

// Bubbles are semi-transparent dots

function drawBubble(size){

penRGB(100,100,255,0.2);

dot(size);

// Sunbeams are semi-transparent lines

function drawSunbeam(size){

penDown();

penWidth(randomNumber(1,15));

penRGB(255,255,255,0.1);

moveForward(size);

penUp();

//9

// Prepare Turtle to Draw

hide();

penUp();
// These six functions draw everything. Order matters

// for how different parts of the picture are layered.

drawBackground();

drawAllSeagrass();

drawAllSeaStars();

drawAllFish();

drawAllBubbles();

drawAllSunbeams();

// To do: Repeatedly draw sea grass

function drawAllSeagrass(){

for (var i = 0; i < 20; i++) {

moveTo(randomNumber(0,320),450);

turnTo(0);

drawSeagrass(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw sea stars

function drawAllSeaStars(){

for (var i = 0; i < 30; i++) {

moveTo(randomNumber(0,320), 450);

turnTo(0);

drawSeaStar(randomNumber(5,20), randomNumber(2, 10));

}
// To do: Repeatedly draw fish

function drawAllFish(){

for (var i = 0; i < 3; i++) {

moveTo(randomNumber(0,120),randomNumber(0,400));

drawFish(randomNumber(5,20),randomNumber(100,255),randomNumber(100,150),120);

// To do: Repeatedly draw bubbles

function drawAllBubbles(){

for (var i = 0; i < 80; i++) {

moveTo(randomNumber(0,360),randomNumber(0,450));

drawBubble(randomNumber(1,40));

// To do: Repeatedly draw sunbeams

function drawAllSunbeams(){

for (var i = 0; i < 60; i++) {

moveTo(randomNumber(-50,120),0);

turnTo(randomNumber(165,175));

drawSunbeam(randomNumber(100,400));

// Make the background by drawing a large blue dot

function drawBackground(){
penColor("DarkBlue");

dot(1000);

// Draw a five-pointed star with a wide pen of the given size

function drawSeaStar(size){

for (var i = 0; i < 10; i++) {

penRGB(255,0,255);

penWidth(10);

penDown();

turnTo(0);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

penUp();

}
// Switches between left and right arcs to make seaGrass with the given radius

function drawSeagrass(radius,numWaves){

penRGB(0,randomNumber(100,200),0);

penWidth(3);

penDown();

arcLeft(30,radius);

// Repeatedly switch between left and right

for(var i = 0; i < numWaves; i++){

arcRight(60,radius);

arcLeft(60,radius);

penUp();

// Draws a fish at the current turtle location with the given size and color

function drawFish(size, red, green, blue){

penRGB(red,green,blue);

penWidth(size);

penDown();

// Fish body

dot(size);

turnTo(90);

moveForward(size);

// Fish tail
turnLeft(30);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

penUp();

// Bubbles are semi-transparent dots

function drawBubble(size){

penRGB(100,100,255,0.2);

dot(size);

// Sunbeams are semi-transparent lines

function drawSunbeam(size){

penDown();

penWidth(randomNumber(1,15));

penRGB(255,255,255,0.1);

moveForward(size);

penUp();

//10

// Prepare Turtle to Draw


hide();

penUp();

// These six functions draw everything. Order matters

// for how different parts of the picture are layered.

drawBackground();

drawAllSeagrass();

drawAllSeaStars();

drawAllFish();

drawAllBubbles();

drawAllSunbeams();

// To do: Repeatedly draw sea grass

function drawAllSeagrass(){

for (var i = 0; i < 20; i++) {

moveTo(randomNumber(0,320),450);

turnTo(0);

drawSeagrass(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw sea stars

function drawAllSeaStars(){

for (var i = 0; i < 30; i++) {

moveTo(randomNumber(0,320), 450);

turnTo(0);

drawSeaStar(randomNumber(5,20), randomNumber(2, 10));


}

// To do: Repeatedly draw fish

function drawAllFish(){

for (var i = 0; i < 3; i++) {

moveTo(randomNumber(0,120),randomNumber(0,400));

drawFish(randomNumber(5,20),randomNumber(100,255),randomNumber(100,150),120);

// To do: Repeatedly draw bubbles

function drawAllBubbles(){

for (var i = 0; i < 80; i++) {

moveTo(randomNumber(0,360),randomNumber(0,450));

drawBubble(randomNumber(1,40));

// To do: Repeatedly draw sunbeams

function drawAllSunbeams(){

for (var i = 0; i < 60; i++) {

moveTo(randomNumber(-50,120),0);

turnTo(randomNumber(165,175));

drawSunbeam(randomNumber(100,400));

}
// Make the background by drawing a large blue dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five-pointed star with a wide pen of the given size

function drawSeaStar(size){

for (var i = 0; i < 10; i++) {

penRGB(255,0,255);

penWidth(10);

penDown();

turnTo(0);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);
penUp();

// Switches between left and right arcs to make seaGrass with the given radius

function drawSeagrass(radius,numWaves){

penRGB(0,randomNumber(100,200),0);

penWidth(3);

penDown();

arcLeft(30,radius);

// Repeatedly switch between left and right

for(var i = 0; i < numWaves; i++){

arcRight(60,radius);

arcLeft(60,radius);

penUp();

// Draws a fish at the current turtle location with the given size and color

function drawFish(size, red, green, blue){

penRGB(red,green,blue);

penWidth(size);

penDown();

// Fish body

dot(size);

turnTo(90);
moveForward(size);

// Fish tail

turnLeft(30);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

penUp();

// Bubbles are semi-transparent dots

function drawBubble(size){

penRGB(100,100,255,0.2);

dot(size);

// Sunbeams are semi-transparent lines

function drawSunbeam(size){

penDown();

penWidth(randomNumber(1,15));

penRGB(255,255,255,0.1);

moveForward(size);

penUp();
}

//11

//12

// Prepare Turtle to Draw

hide();

penUp();

// These six functions draw everything. Order matters

// for how different parts of the picture are layered.

drawBackground();

drawAllSeagrass();

drawAllSeaStars();

drawAllFish();

drawAllBubbles();

drawAllSunbeams();

// To do: Repeatedly draw sea grass

function drawAllSeagrass(){

for (var i = 0; i < 20; i++) {

moveTo(randomNumber(0,320),450);

turnTo(0);

drawSeagrass(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw sea stars


function drawAllSeaStars(){

for (var i = 0; i < 30; i++) {

moveTo(randomNumber(0,320), 450);

turnTo(0);

drawSeaStar(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw fish

function drawAllFish(){

for (var i = 0; i < 3; i++) {

moveTo(randomNumber(0,120),randomNumber(0,400));

drawFish(randomNumber(5,20),randomNumber(100,255),randomNumber(100,150),120);

// To do: Repeatedly draw bubbles

function drawAllBubbles(){

for (var i = 0; i < 80; i++) {

moveTo(randomNumber(0,360),randomNumber(0,450));

drawBubble(randomNumber(1,40));

// To do: Repeatedly draw sunbeams

function drawAllSunbeams(){

for (var i = 0; i < 60; i++) {


moveTo(randomNumber(-50,120),0);

turnTo(randomNumber(165,175));

drawSunbeam(randomNumber(100,400));

// Make the background by drawing a large blue dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five-pointed star with a wide pen of the given size

function drawSeaStar(size){

for (var i = 0; i < 10; i++) {

penRGB(255,0,255);

penWidth(10);

penDown();

turnTo(0);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);
moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

penUp();

// Switches between left and right arcs to make seaGrass with the given radius

function drawSeagrass(radius,numWaves){

penRGB(0,randomNumber(100,200),0);

penWidth(3);

penDown();

arcLeft(30,radius);

// Repeatedly switch between left and right

for(var i = 0; i < numWaves; i++){

arcRight(60,radius);

arcLeft(60,radius);

penUp();

// Draws a fish at the current turtle location with the given size and color

function drawFish(size, red, green, blue){

penRGB(red,green,blue);

penWidth(size);
penDown();

// Fish body

dot(size);

turnTo(90);

moveForward(size);

// Fish tail

turnLeft(30);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

penUp();

// Bubbles are semi-transparent dots

function drawBubble(size){

penRGB(100,100,255,0.2);

dot(size);

// Sunbeams are semi-transparent lines

function drawSunbeam(size){
penDown();

penWidth(randomNumber(1,15));

penRGB(255,255,255,0.1);

moveForward(size);

penUp();

//13

// Prepare Turtle to Draw

hide();

penUp();

// These six functions draw everything. Order matters

// for how different parts of the picture are layered.

drawBackground();

drawAllSeagrass();

drawAllSeaStars();

drawAllFish();

drawAllBubbles();

drawAllSunbeams();

// To do: Repeatedly draw sea grass

function drawAllSeagrass(){

for (var i = 0; i < 20; i++) {

moveTo(randomNumber(0,320),450);

turnTo(0);

drawSeagrass(randomNumber(5,20), randomNumber(2, 10));

}
}

// To do: Repeatedly draw sea stars

function drawAllSeaStars(){

for (var i = 0; i < 30; i++) {

moveTo(randomNumber(0,320), 450);

turnTo(0);

drawSeaStar(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw fish

function drawAllFish(){

for (var i = 0; i < 3; i++) {

moveTo(randomNumber(0,120),randomNumber(0,400));

drawFish(randomNumber(5,20),randomNumber(100,255),randomNumber(100,150),120);

// To do: Repeatedly draw bubbles

function drawAllBubbles(){

for (var i = 0; i < 80; i++) {

moveTo(randomNumber(0,360),randomNumber(0,450));

drawBubble(randomNumber(1,40));

}
// To do: Repeatedly draw sunbeams

function drawAllSunbeams(){

for (var i = 0; i < 60; i++) {

moveTo(randomNumber(-50,120),0);

turnTo(randomNumber(165,175));

drawSunbeam(randomNumber(100,400));

// Make the background by drawing a large blue dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five-pointed star with a wide pen of the given size

function drawSeaStar(size){

for (var i = 0; i < 10; i++) {

penRGB(255,0,255);

penWidth(10);

penDown();

turnTo(0);

moveForward(size);

turnRight(144);

moveForward(size);
turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

penUp();

// Switches between left and right arcs to make seaGrass with the given radius

function drawSeagrass(radius,numWaves){

penRGB(0,randomNumber(100,200),0);

penWidth(3);

penDown();

arcLeft(30,radius);

// Repeatedly switch between left and right

for(var i = 0; i < numWaves; i++){

arcRight(60,radius);

arcLeft(60,radius);

penUp();

// Draws a fish at the current turtle location with the given size and color
function drawFish(size, red, green, blue){

penRGB(red,green,blue);

penWidth(size);

penDown();

// Fish body

dot(size);

turnTo(90);

moveForward(size);

// Fish tail

turnLeft(30);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

penUp();

// Bubbles are semi-transparent dots

function drawBubble(size){

penRGB(100,100,255,0.2);

dot(size);

}
// Sunbeams are semi-transparent lines

function drawSunbeam(size){

penDown();

penWidth(randomNumber(1,15));

penRGB(255,255,255,0.1);

moveForward(size);

penUp();

//14

// Prepare Turtle to Draw

hide();

penUp();

// These six functions draw everything. Order matters

// for how different parts of the picture are layered.

drawBackground();

drawAllSeagrass();

drawAllSeaStars();

drawAllFish();

drawAllBubbles();

drawAllSunbeams();

// To do: Repeatedly draw sea grass

function drawAllSeagrass(){

for (var i = 0; i < 20; i++) {

moveTo(randomNumber(0,320),450);
turnTo(0);

drawSeagrass(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw sea stars

function drawAllSeaStars(){

for (var i = 0; i < 30; i++) {

moveTo(randomNumber(0,320), 450);

turnTo(0);

drawSeaStar(randomNumber(5,20), randomNumber(2, 10));

// To do: Repeatedly draw fish

function drawAllFish(){

for (var i = 0; i < 3; i++) {

moveTo(randomNumber(0,120),randomNumber(0,400));

drawFish(randomNumber(5,20),randomNumber(100,255),randomNumber(100,150),120);

// To do: Repeatedly draw bubbles

function drawAllBubbles(){

for (var i = 0; i < 80; i++) {

moveTo(randomNumber(0,360),randomNumber(0,450));

drawBubble(randomNumber(1,40));
}

// To do: Repeatedly draw sunbeams

function drawAllSunbeams(){

for (var i = 0; i < 60; i++) {

moveTo(randomNumber(-50,120),0);

turnTo(randomNumber(165,175));

drawSunbeam(randomNumber(100,400));

// Make the background by drawing a large blue dot

function drawBackground(){

penColor("DarkBlue");

dot(1000);

// Draw a five-pointed star with a wide pen of the given size

function drawSeaStar(size){

for (var i = 0; i < 10; i++) {

penRGB(255,0,255);

penWidth(10);

penDown();

turnTo(0);
moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

moveForward(size);

turnRight(144);

penUp();

// Switches between left and right arcs to make seaGrass with the given radius

function drawSeagrass(radius,numWaves){

penRGB(0,randomNumber(100,200),0);

penWidth(3);

penDown();

arcLeft(30,radius);

// Repeatedly switch between left and right

for(var i = 0; i < numWaves; i++){

arcRight(60,radius);

arcLeft(60,radius);

penUp();
}

// Draws a fish at the current turtle location with the given size and color

function drawFish(size, red, green, blue){

penRGB(red,green,blue);

penWidth(size);

penDown();

// Fish body

dot(size);

turnTo(90);

moveForward(size);

// Fish tail

turnLeft(30);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

moveForward(size);

turnRight(120);

penUp();

// Bubbles are semi-transparent dots

function drawBubble(size){
penRGB(100,100,255,0.2);

dot(size);

// Sunbeams are semi-transparent lines

function drawSunbeam(size){

penDown();

penWidth(randomNumber(1,15));

penRGB(255,255,255,0.1);

moveForward(size);

penUp();

//16 A,C

Unit 4

l9

//8

Cheia de criptare este publică, dar cheia de decriptare este privată, iar cu două chei diferite, va fi mai
greu să spargem criptarea asimetrică.

//10

Criptarea cheii publice este greu de crestat deoarece poate fi decriptată numai atunci când este
combinată cu o cheie privată asociată matematic.

//13

Criptarea cheii publice este greu de crestat deoarece poate fi decriptată numai atunci când este
combinată cu o cheie privată asociată matematic.

L8

//5

Spargerea unui cod înseamnă încercarea și rezolvarea unui cod pentru a-l putea înțelege, în timp ce
decriptarea este procesul de transformare a datelor criptate in date care pot fi citite cu usurinta.

//7
Nu as fi de acord cu trimiterea parolei pe internet nici sub forma de cod. Oricand se poate afla, cu
greu, dar se poate afla, facand toate combinatiile posibile.

//8

Lungimea cheii contează; o cheie de 20 ar produce un mesaj "mai bun" criptat decât o cheie de 5,
deoarece este mai complex și are mai multe posibilități, ceea ce face mult mai greu să se spargă.

L7

//7

Consider ca cel mai important ar fi ca pe retelele de socializare sa fie pastrate secret datele cu
caracter personal.

//8

Aplicarea cifrului lui Cezar asupra unui text oarecare constă în înlocuirea fiecărei litere din textul
inițial cu una care se află la o distanță fixă în alfabet. Acest exemplu este cu o deplasare de trei
poziții, astfel încât B din textul inițial devine E în textul criptat.

În criptografie, cifrul lui Cezar, numit și cifru cu deplasare, codul lui Cezar sau deplasarea lui Cezar,
este una dintre cele mai simple și mai cunoscute tehnici de criptare. Este un tip de cifru al
substituției, în care fiecare literă din textul inițial este înlocuită cu o literă care se află în alfabet la o
distanță fixă față de cea înlocuită.

//11

codificare, schimb, confidentialitate

//12

Nu as fi de acord cu trimiterea parolei pe internet nici sub forma de cod. Oricand se poate afla, cu
greu, dar se poate afla, facand toate combinatiile posibile.

Unit 1

L1// Students were afraid of being judged by other colleagues because they knew nothing about this
code. After a while they realized that everyone was going through the same state and that it was
normal.

L2//By sending a binary question, you can get a quicker and more effective response.

4//O intrebare care nu poate avea ca raspuns un mesaj binar poate fi: "Care este culoarea ta
preferata?". Aceasta nu este o intrebare binara, deoarece exista mai multe culori la alegere, nu doar
doua.

5//Colaborarea a afectat dezvoltarea protocolului nostru prin aducerea unor idei diferite care să fie
mai eficiente. Unele provocări pe care le-am avut prin colaborarea in grup au fost reprezentate de
analiza asupra celui mai bun mod de a număra ceva. Cu toate acestea, ea nu aduce idei multiple
pentru a avea un produs mai bun în cele din urmă.
L3

//6 Mesajul conform graficului este ABABB. Cu toate acestea, nu putem fi siguri de semnificația lui
decât dacă cunoaștem contextul mesajului. Trebuie să cunoaștem sistemul de întrebări și răspunsuri
folosit, deoarece fără acesta, această informație nu are sens.

L4// 3 Regulile sunt necesare pentru un sistem numeric, deoarece fără ele nimeni nu ar ști cât de
mult reprezintă fiecare simbol și nimeni nu ar fi capabil să descifreze mesajul.

L5// 3

Valoarea locului este folosită în sistemul de numere binare pentru a ajuta la alinierea modului în care
trebuie să se scrie un număr. Este diferit deoarece, în baza zece, valoarea locului crește mai mult
decât in baza 2.

//4

Ce am retinut:

- Creșteri zecimale și hexazecimale la aceeași rată

- Creșterea octală cu 2 mai mult decât cea zecimală

- Binar reprezintă numărul octal în termeni binari

observaţii:

- Numere și litere cu utilizare hexazecimală

- Când hexadecimal a început să utilizeze litere, numărul nu a rămas același ca in cifre zecimale

Intelegre:

- Puteți scrie in sistem zecimal dacă înțelegeți sistemul binary

L6//3Nu am știut cum sa atingem toate acele puncte. Nu am avut timp suficient pentru a rezolva
această problemă.

L7//6 Această afirmație este întotdeauna adevărată deoarece, atunci când am pus modelul binar în
calculatorul meu, a continuat să iasă numarul 65 dupa mai multe apeluri.

L7// 7 - Eu și partenerul meu am folosit numerele zecimale pentru a reprezenta litere, ceea ce ne-a
permis să scriem un mesaj simplu între ele.

- Sunt utile pentru că vă ajută să identificați ce programator codifică

L8//6Internetul este controlat de toată lumea, dar dacă unul dintre furnizorii de rețele locale i-ar
monopoliza pe ceilalți, atunci ar deveni lider suprem pe internet. Dar, Cerf afirmă că nu este posibil
acest lucru, deoarece internetul este creat in asa fel incat nu există un control central care să decidă
modul în care pachetele sunt direcționate sau în care piesele sunt rețele sau construite.

l9//4 We decided if a person called out a certain spot and who they were aiming towards, that
person aimed towards would have to respond back with either hit or miss. Yes because some of the
people in my group saw this as a way for someone to cheat. We resolved it by everyone shading their
chosen areas with a pen so everyone would know exactly who won with evidence when the game
ended.

//7

Some privacy and security challenges could happen if your Internet is public, it would allow others to
interfere with the simulator. Also, if you lose your WiFi, this would have resulted in you restarting the
game over again and losing your position.

L10//6Un router este mai sigur deoarece are mai multe firewall-uri și metode pentru protejarea
datelor. În timp ce o difuzare este mai răspândită și disponibilă pentru masele de oameni.

//7

Depinde unde merge mesajul, deoarece dacă este un traseu local, poate fi mai ușor de obținut. Dacă
trimiteți un mesaj în străinătate sau în afara statului, acea cale poate fi puțin mai dificil de
determinat.

S-ar putea să vă placă și