0% found this document useful (0 votes)
41 views9 pages

Bakerfranke - Github.io Codeprint

Uploaded by

zfokonkwo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views9 pages

Bakerfranke - Github.io Codeprint

Uploaded by

zfokonkwo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

4/26/24, 7:33 PM bakerfranke.github.

io/codePrint/

var PlanetDensity = getColumn("Planets of our Solar System", "Density");


var PlanetMeasure = getColumn("Planets of our Solar System", "Diameter");
var PlanetDayLength = getColumn("Planets of our Solar System", "Length of day");
var PlanetToSun = getColumn("Planets of our Solar System", "Distance from sun");
var PlanetMoons = getColumn("Planets of our Solar System", "Number of moons");
var PlanetTemp = getColumn("Planets of our Solar System", "Mean temperature");

//Picture on SolarSystem screen: https://st2.depositphotos.com/1011081/9445/i/450/depositphotos_94


//https://www.google.com/url?sa=i&url=https%3A%2F%2Ffanyv88.com%3A443%2Fhttps%2Fdepositphotos.com%2Fphotos%2Fsolar-system.html&

onEvent("Choice1", "click", function( ) {


setScreen("PlanetPicker");
});
onEvent("backbutton1", "click", function( ) {
setScreen("SolarSystem");
});
onEvent("planetVisit1", "click", function( ) {
setScreen("mercuryView");
});
onEvent("backToWheel1", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit2", "click", function( ) {
setScreen("venusView");
});
onEvent("backToWheel2", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit3", "click", function( ) {
setScreen("earthView");
});
onEvent("backToWheel3", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit4", "click", function( ) {
setScreen("marsView");
});
onEvent("backToWheel4", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit5", "click", function( ) {
setScreen("jupiterView");
});
onEvent("backToWheel5", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit6", "click", function( ) {
setScreen("saternView");
});
onEvent("backToWheel6", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit7", "click", function( ) {

https://bakerfranke.github.io/codePrint/ 1/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

setScreen("uranusView");
});
onEvent("backToWheel7", "click", function( ) {
setScreen("PlanetPicker");
});
onEvent("planetVisit8", "click", function( ) {
setScreen("neptuneView");
});
onEvent("backToWheel8", "click", function( ) {
setScreen("PlanetPicker");
});

//planet pictures:
//mercury: https://www.pngall.com/mercury-planet-png/ or https://www.pngall.com/wp-content/upload
//venus:https://static.vecteezy.com/system/resources/previews/032/325/107/original/venus-planet-is
//Earth:https://upload.wikimedia.org/wikipedia/commons/thumb/2/22/Earth_Western_Hemisphere_transpa
//Mars:https://www.pngall.com/wp-content/uploads/13/Mars-PNG-Picture.png
//Jupiter:https://static.vecteezy.com/system/resources/previews/027/294/102/original/jupiter-plane
//Satern:https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/3D_Saturn.png/640px-3D_Saturn.p
//Uranus:https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ44dj6qkkbeMUBDvzHL6I1KSWiiKDdOJgDV
//Neptune:https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTrg6ZjI8_uxj_C4IoyFKK1s_SqOtd1nWu0

//*****Picture of arrow: https://www.freeiconspng.com/thumbs/white-arrow-png/white-arrow-transpare


//arrow picture website: https://www.freeiconspng.com/images/white-arrow-png

//hides all the arrows


setProperty("arrowdirect1", "hidden", true);
setProperty("arrowdirect2", "hidden", true);
setProperty("arrowdirect3", "hidden", true);
setProperty("arrowdirect4", "hidden", true);
setProperty("arrowdirect5", "hidden", true);
setProperty("arrowdirect6", "hidden", true);
setProperty("arrowdirect7", "hidden", true);
setProperty("arrowdirect8", "hidden", true);

//hides all buttons that take you to certain planets


setProperty("planetVisit1", "hidden", true);
setProperty("planetVisit2", "hidden", true);
setProperty("planetVisit3", "hidden", true);
setProperty("planetVisit4", "hidden", true);
setProperty("planetVisit5", "hidden", true);
setProperty("planetVisit6", "hidden", true);
setProperty("planetVisit7", "hidden", true);
setProperty("planetVisit8", "hidden", true);

//the below functions help with showing the right directional arrow when a certain planet is click
function togglePlanetVisit(buttonId, arrowIndex) {
hideAllArrows();
showArrow(buttonId, arrowIndex);
}
function hideAllArrows() {
for (var i = 1; i <= 8; i++) {
setProperty("arrowdirect" + i, "hidden", true);
}
}
function showArrow(buttonId, arrowIndex) {

https://bakerfranke.github.io/codePrint/ 2/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

setProperty("arrowdirect" + arrowIndex, "hidden", false);


for (var i = 1; i <= 8; i++) {
setProperty("planetVisit" + i, "hidden", i !== arrowIndex);
}
}
onEvent("mercuryButton", "click", function( ) {
togglePlanetVisit("mercuryButton", 1);
});
onEvent("venusButton", "click", function( ) {
togglePlanetVisit("venusButton", 2);
});
onEvent("earthButton", "click", function( ) {
togglePlanetVisit("earthButton", 3);
});
onEvent("marsButton", "click", function( ) {
togglePlanetVisit("marsButton", 4);
});
onEvent("jupiterButton", "click", function( ) {
togglePlanetVisit("jupiterButton", 5);
});
onEvent("saturnButton", "click", function( ) {
togglePlanetVisit("saturnButton", 6);
});
onEvent("uranusButton", "click", function( ) {
togglePlanetVisit("uranusButton", 7);
});
onEvent("neptuneButton", "click", function( ) {
togglePlanetVisit("neptuneButton", 8);
});

//Red flag: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcScE1hxSLhqYanydidMkdTXCmWfAu20l3


//The functions below make the flag buttons on each planet screen to function.
setProperty("mdescription1", "hidden", true);
setProperty("mdescription2", "hidden", true);
setProperty("mdescription3", "hidden", true);
function showMercuryInfo(mInfoIndex) {
var mdiscriptions = ["mdescription1", "mdescription2", "mdescription3"];
var mfunctions = [mercuryInfo1, mercuryInfo2, mercuryInfo3];
for (var i = 0; i < mdiscriptions.length; i++) {
if (i === mInfoIndex) {
setProperty(mdiscriptions[i], "hidden", false);
} else {
setProperty(mdiscriptions[i], "hidden", true);
}
}
mfunctions[mInfoIndex]();
}
function mercuryInfo1() {
var mercuryDensity = PlanetDensity[0];
var mercuryDiameter = PlanetMeasure[0];
setText("mdescription1", (("Mercury's density is " + mercuryDensity) + " and Mercury's diameter is
}
function mercuryInfo2() {
var mercuryDayLength = PlanetDayLength[0];
var mercurySunsDistance = PlanetToSun[0];
setText("mdescription2", ((("The length of Mercury's days are " + mercuryDayLength) + " and Mercury

https://bakerfranke.github.io/codePrint/ 3/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

}
function mercuryInfo3() {
var mercuryMoons = PlanetMoons[0];
var mercuryTemperature = PlanetTemp[0];
setText("mdescription3", ((("The number of moons Mercury has is " + mercuryMoons) + " and Mercury'
}
onEvent("mFlagButton1", "click", function( ) {
showMercuryInfo(0);
});
onEvent("mFlagButton2", "click", function( ) {
showMercuryInfo(1);
});
onEvent("mFlagButton3", "click", function( ) {
showMercuryInfo(2);
});

setProperty("vdescription1", "hidden", true);


setProperty("vdescription2", "hidden", true);
setProperty("vdescription3", "hidden", true);
function showVenusInfo(vInfoIndex) {
var vdiscriptions = ["vdescription1", "vdescription2", "vdescription3"];
var vfunctions = [venusInfo1, venusInfo2, venusInfo3];
for (var i = 0; i < vdiscriptions.length; i++) {
if (i === vInfoIndex) {
setProperty(vdiscriptions[i], "hidden", false);
} else {
setProperty(vdiscriptions[i], "hidden", true);
}
}
vfunctions[vInfoIndex]();
}
function venusInfo1() {
var venusDensity = PlanetDensity[1];
var venusDiameter = PlanetMeasure[1];
setText("vdescription1", ((("Venus' density is " + venusDensity) + " and Venus' diameter is ") + v
}
function venusInfo2() {
var venusDayLength = PlanetDayLength[1];
var venusSunsDistance = PlanetToSun[1];
setText("vdescription2", ((("The length of Venus' days are " + venusDayLength) + " and Venus' dist
}
function venusInfo3() {
var venusMoons = PlanetMoons[1];
var venusTemperature = PlanetTemp[1];
setText("vdescription3", ((("The number of moons Venus has is " + venusMoons) + " and Venus' tempe
}
onEvent("vFlagButton1", "click", function( ) {
showVenusInfo(0);
});
onEvent("vFlagButton2", "click", function( ) {
showVenusInfo(1);
});
onEvent("vFlagButton3", "click", function( ) {
showVenusInfo(2);
});

https://bakerfranke.github.io/codePrint/ 4/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

setProperty("edescription1", "hidden", true);


setProperty("edescription2", "hidden", true);
setProperty("edescription3", "hidden", true);
function showEarthInfo(eInfoIndex) {
var ediscriptions = ["edescription1", "edescription2", "edescription3"];
var efunctions = [earthInfo1, earthInfo2, earthInfo3];
for (var i = 0; i < ediscriptions.length; i++) {
if (i === eInfoIndex) {
setProperty(ediscriptions[i], "hidden", false);
} else {
setProperty(ediscriptions[i], "hidden", true);
}
}
efunctions[eInfoIndex]();
}
function earthInfo1() {
var earthDensity = PlanetDensity[2];
var earthDiameter = PlanetMeasure[2];
setText("edescription1", ((("Earth's density is " + earthDensity) + " and Earth's diameter is ") +
}
function earthInfo2() {
var earthDayLength = PlanetDayLength[2];
var earthSunsDistance = PlanetToSun[2];
setText("edescription2", ((("The length of Earth's days are " + earthDayLength) + " and Earth's di
}
function earthInfo3() {
var earthMoons = PlanetMoons[2];
var earthTemperature = PlanetTemp[2];
setText("edescription3", ((("The number of moons Earth has is " + earthMoons) + " and Earth's temp
}
onEvent("eFlagButton1", "click", function( ) {
showEarthInfo(0);
});
onEvent("eFlagButton2", "click", function( ) {
showEarthInfo(1);
});
onEvent("eFlagButton3", "click", function( ) {
showEarthInfo(2);
});

setProperty("madescription1", "hidden", true);


setProperty("madescription2", "hidden", true);
setProperty("madescription3", "hidden", true);
function showMarsInfo(maInfoIndex) {
var madiscriptions = ["madescription1", "madescription2", "madescription3"];
var mafunctions = [marsInfo1, marsInfo2, marsInfo3];
for (var i = 0; i < madiscriptions.length; i++) {
if (i === maInfoIndex) {
setProperty(madiscriptions[i], "hidden", false);
} else {
setProperty(madiscriptions[i], "hidden", true);
}
}
mafunctions[maInfoIndex]();
}
function marsInfo1() {

https://bakerfranke.github.io/codePrint/ 5/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

var marsDensity = PlanetDensity[3];


var marsDiameter = PlanetMeasure[3];
setText("madescription1", ((("Mars' density is " + marsDensity) + " and Mars' diameter is ") + mar
}
function marsInfo2() {
var marsDayLength = PlanetDayLength[3];
var marsSunsDistance = PlanetToSun[3];
setText("madescription2", ((("The length of Mars' days are " + marsDayLength) + " and Mars' distan
}
function marsInfo3() {
var marsMoons = PlanetMoons[3];
var marsTemperature = PlanetTemp[3];
setText("madescription3", ((("The number of moons Mars has is " + marsMoons) + " and Mars' tempera
}
onEvent("maFlagButton1", "click", function( ) {
showMarsInfo(0);
});
onEvent("maFlagButton2", "click", function( ) {
showMarsInfo(1);
});
onEvent("maFlagButton3", "click", function( ) {
showMarsInfo(2);
});

setProperty("jdescription1", "hidden", true);


setProperty("jdescription2", "hidden", true);
setProperty("jdescription3", "hidden", true);
function showJupiterInfo(jInfoIndex) {
var jdiscriptions = ["jdescription1", "jdescription2", "jdescription3"];
var jfunctions = [jupiterInfo1, jupiterInfo2, jupiterInfo3];
for (var i = 0; i < jdiscriptions.length; i++) {
if (i === jInfoIndex) {
setProperty(jdiscriptions[i], "hidden", false);
} else {
setProperty(jdiscriptions[i], "hidden", true);
}
}
jfunctions[jInfoIndex]();
}
function jupiterInfo1() {
var jupiterDensity = PlanetDensity[4];
var jupiterDiameter = PlanetMeasure[4];
setText("jdescription1", ((("Jupiter's density is " + jupiterDensity) + " and Jupiter's diameter i
}
function jupiterInfo2() {
var jupiterDayLength = PlanetDayLength[4];
var jupiterSunsDistance = PlanetToSun[4];
setText("jdescription2", ((("The length of Jupiters's days are " + jupiterDayLength) + " and Jupit
}
function jupiterInfo3() {
var jupiterMoons = PlanetMoons[4];
var jupiterTemperature = PlanetTemp[4];
setText("jdescription3", ((("The number of moons Jupiter has is " + jupiterMoons) + " and Jupiter'
}
onEvent("jFlagButton1", "click", function( ) {
showJupiterInfo(0);

https://bakerfranke.github.io/codePrint/ 6/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

});
onEvent("jFlagButton2", "click", function( ) {
showJupiterInfo(1);
});
onEvent("jFlagButton3", "click", function( ) {
showJupiterInfo(2);
});

setProperty("sdescription1", "hidden", true);


setProperty("sdescription2", "hidden", true);
setProperty("sdescription3", "hidden", true);
function showSaternInfo(sInfoIndex) {
var sdiscriptions = ["sdescription1", "sdescription2", "sdescription3"];
var sfunctions = [saternInfo1, saternInfo2, saternInfo3];
for (var i = 0; i < sdiscriptions.length; i++) {
if (i === sInfoIndex) {
setProperty(sdiscriptions[i], "hidden", false);
} else {
setProperty(sdiscriptions[i], "hidden", true);
}
}
sfunctions[sInfoIndex]();
}
function saternInfo1() {
var saternDensity = PlanetDensity[5];
var saternDiameter = PlanetMeasure[5];
setText("sdescription1", ((("Satern's density is " + saternDensity) + " and Satern's diameter is "
}
function saternInfo2() {
var saternDayLength = PlanetDayLength[5];
var saternSunsDistance = PlanetToSun[5];
setText("sdescription2", ((("The length of Satern's days are " + saternDayLength) + " and Satern's
}
function saternInfo3() {
var saternMoons = PlanetMoons[5];
var saternTemperature = PlanetTemp[5];
setText("sdescription3", ((("The number of moons Satern has is " + saternMoons) + " and Satern's t
}
onEvent("sFlagButton1", "click", function( ) {
showSaternInfo(0);
});
onEvent("sFlagButton2", "click", function( ) {
showSaternInfo(1);
});
onEvent("sFlagButton3", "click", function( ) {
showSaternInfo(2);
});

setProperty("udescription1", "hidden", true);


setProperty("udescription2", "hidden", true);
setProperty("udescription3", "hidden", true);
function showUranusInfo(uInfoIndex) {
var udiscriptions = ["udescription1", "udescription2", "udescription3"];
var ufunctions = [uranusInfo1, uranusInfo2, uranusInfo3];
for (var i = 0; i < udiscriptions.length; i++) {
if (i === uInfoIndex) {

https://bakerfranke.github.io/codePrint/ 7/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/

setProperty(udiscriptions[i], "hidden", false);


} else {
setProperty(udiscriptions[i], "hidden", true);
}
}
ufunctions[uInfoIndex]();
}
function uranusInfo1() {
var uranusDensity = PlanetDensity[6];
var uranusDiameter = PlanetMeasure[6];
setText("udescription1", ((("Uranus' density is " + uranusDensity) + " and Uranus' diameter is ")
}
function uranusInfo2() {
var uranusDayLength = PlanetDayLength[6];
var uranusSunsDistance = PlanetToSun[6];
setText("udescription2", ((("The length of Uranus' days are " + uranusDayLength) + " and Uranus' d
}
function uranusInfo3() {
var uranusMoons = PlanetMoons[6];
var uranusTemperature = PlanetTemp[6];
setText("udescription3", ((("The number of moons Uranus has is " + uranusMoons) + " and Uranus' te
}
onEvent("uFlagButton1", "click", function( ) {
showUranusInfo(0);
});
onEvent("uFlagButton2", "click", function( ) {
showUranusInfo(1);
});
onEvent("uFlagButton3", "click", function( ) {
showUranusInfo(2);
});

setProperty("ndescription1", "hidden", true);


setProperty("ndescription2", "hidden", true);
setProperty("ndescription3", "hidden", true);
function showNeptuneInfo(nInfoIndex) {
var ndiscriptions = ["ndescription1", "ndescription2", "ndescription3"];
var nfunctions = [neptuneInfo1, neptuneInfo2, neptuneInfo3];
for (var i = 0; i < ndiscriptions.length; i++) {
if (i === nInfoIndex) {
setProperty(ndiscriptions[i], "hidden", false);
} else {
setProperty(ndiscriptions[i], "hidden", true);
}
}
nfunctions[nInfoIndex]();
}
function neptuneInfo1() {
var neptuneDensity = PlanetDensity[7];
var neptuneDiameter = PlanetMeasure[7];
setText("ndescription1", ((("Neptune's density is " + neptuneDensity) + " and Neptune's diameter i
}
function neptuneInfo2() {
var neptuneDayLength = PlanetDayLength[7];
var neptuneSunsDistance = PlanetToSun[7];
setText("ndescription2", ((("The length of Neptune's days are " + neptuneDayLength) + " and Neptun

https://bakerfranke.github.io/codePrint/ 8/9
4/26/24, 7:33 PM bakerfranke.github.io/codePrint/
450
}
451
function neptuneInfo3() {
452
var neptuneMoons = PlanetMoons[7];
453
var neptuneTemperature = PlanetTemp[7];
454
setText("ndescription3", ((("The number of moons Neptune has is " + neptuneMoons) + " and Neptune'
455
}
456
onEvent("nFlagButton1", "click", function( ) {
457
showNeptuneInfo(0);
458
});
459
onEvent("nFlagButton2", "click", function( ) {
460
showNeptuneInfo(1);
});
onEvent("nFlagButton3", "click", function( ) {
showNeptuneInfo(2);
});

PDF document made with CodePrint using Prism

https://bakerfranke.github.io/codePrint/ 9/9

You might also like