I completed the Grasshopper App and now I wanted to code more but I feel confused what i even learned I downloaded the program eclipse on my pc and tried to write a easy code and nothing came out I needed to write system.out.println (âhelloâ) and not that what I have learned in your app so what a program do you use or what a language did I even learn
Ps: the app is very good I loved to complete it and thx for helping
i think they said Javascript
Grasshopper is teaching JavaScript which is a different language from Java. If you want a quick way to play with JavaScript on your computer, try right clicking on this post (or anywhere in the main window of your internet browser). In Chrome, there should be an option to âinspectâ. This will bring up developer tools. In the âConsoleâ tab, you can input JavaScript commands, but it may be tricky to do any multi-line functions. In the âSourcesâ tab, you can go to âSnippetsâ, and create a new little program. There should be an option to run your code in the bottom right.
Here is a post about some of the functions written for Grasshopper. It means that some functions, like drawBox()
, pickRandom()
, and print()
are specific to Grasshopper.
Java: System.out.println("hello");
JavaScript: console.log("hello");
âFrankie
Then whatâs the use if i can not apply !! I dont want to learn for grasshopper⌠I learn real javascript and how to implement it. App starts with drawBoxes that most probably does not exist at all in real javascript⌠!!
Sololearn is far better at least it starts with real technique and tell the learner where to implement !!
leaving Hopper
I have completed many topics but the basic is not clear. Like where to write and how to execute !! I dont think writing just the codes will give output like adding or something must be necessary.
i am new to programming and donât know where to write and how to execute and what to add extras !!
It sounds like youâre wondering how to run code outside of the app. Hereâs a short post on how to play around with JavaScript in your browser.
If you want to experiment more with animations (or non-animation things too), you can try the animations playground.
âFrankie
as you said⌠Then whatâs the use if i can not apply !! I dont want to learn for grasshopper⌠I want to learn real javascript and how to implement it. App starts with drawBoxes that most probably does not exist at all in real javascript⌠!!
Sololearn is far better at least it starts with real technique and tell the learner where to put codes and how to see it working in real life.
Frustated âŚ
I am new to coding, and Grasshopper has been fun.
To have a better understanding of coding and how it is related to Grasshopper,
I downloaded Android studio to make the connection.
I could not find much connection between what I have learnt and Android studio.
There wasnât any âVarâ or the âConsole.logâ for me to relate to.
(And the Android studio, although it should be very simple and convenient, I was lost.)
So, how can Grasshopper be related to coding with the coding programs out there in the market.
What is a better coding program to code in after learning Grasshopper.
I am very new to coding, so my questions may be naive.
Thank you
You were likely being prompted to create a Java program in Android Studio. This is different from JavaScript, so there isnât a var
or console.log()
.
Heather has a post about using VS Code to make JavaScript projects or using JSFiddle to experiment.
âFrankie
I have been trying to use javascript on other sources to see if it would work. But I would just get errors when i run it. I am looking at a lot of examples and see a lot of <> with something in-between before the coding etc⌠So here are my questions.
What does<> mean and why do i need it?
Am i required to know any other language to get javascript to run?
Where can I solely use Javascript?
Any help at all will relief my frustration, so thanks for your service
The <> are called âHTML tagsâ and theyâre used to format webpages. You can run JavaScript code without knowing other languages by using the console in your internet browser, like Chrome. Some of the code used in Grasshopper is not built into JavaScript, but are actually JavaScript functions that we made and included in the app. You can create your own versions of these functions. For example,
function print(x) {
console.log(x);
}
print('Now I can print');
Below is a more in-depth explanation to each of your questions.
The <> you see are HTML tags. These are used when creating a webpage. If youâre trying to write JavaScript on an online tool and you want to see some kind of output on the screen, either text or images, youâll use these to format your output in a way the internet browser can understand. There is usually a start and end tag, just like parentheses, except an end tag will have a forward slash in it: <tag>The thing being tagged</tag>
If you reply to this post, you can try out some html tags to format your text:
- Bold: <b>This will be bolded text</b>
- Italic: <i>This will be italicized text</i>
-
Strikethough:<s>This text will be striked out</s>
There are lots of types of tags. If youâre using Chrome on a desktop, right click on this webpage and click âView Page Sourceâ, youâll see the tags used to format this website. Itâs a bit overwhelming, but if you just look at the first few lines:
<!DOCTYPE html>
<html lang="en" class="desktop-view not-mobile-device ">
<head>
<meta charset="utf-8">
<title>I feel confused - Issues - Grasshopper Support</title>
<meta name="description" content="I completed the Grasshopper App and now...">
<meta name="discourse_theme_ids" content="1">
<meta name="discourse_current_homepage" content="latest">
<meta name="author" content="">
It starts by saying, âThis is an html documentâ. Then thereâs a start tag for <html>
with extra info included in the tag. Inside of that <html>
section, thereâs a <head>
section, and inside that, there are things tagged with <meta>
and <title>
. If you look at the text thatâs tagged with <title>
, youâll notice itâs exactly the text that is on this internet tab. Now, Iâll show you something cool.
Right click on the webpage again, and then select âInspectâ. This will bring up the developer tools if youâre using Google Chrome. There are several tabs at the top of this section, but the ones to notice are âElementsâ, âConsoleâ, and âSourcesâ. Make sure youâre on âElementsâ. If you scroll all the way to the top of the code, youâll see the same stuff that was in the Page Source. The <!DOCTYPE html>
, then the html tag, then the <head>
section. The <head>
will probably be collapsed/hidden. Just tap the little triangle and it will expand the code. Inside there, if you scroll down about 10 lines, youâll see the <title>
tag again. Try double clicking the text inside and editing it. When you press enter, the text on your tab will change. This isnât affecting the content for other people using the webpage, only you will see the change. In fact, if you hit Refresh, it will go back to the original because your browser is reloading the data from the original source (or a copy stored somewhere else).
Now click on the Console tab on the developer tools. You can run JavaScript here, but remember that it doesnât know about any custom Grasshopper functions, like drawBox
, pickRandom
, or print
. If you do try to print('hi')
, it will open the âprint this pageâ window. If youâve made seen the lessons in Fundamentals II, you might already know about console.log()
. This will do what print()
does in the app. Type console.log('hi')
in the console and press enter, it will write out hi
, just like youâd hope. In case youâre wondering, the undefined
at the end is the return
value from console.log()
because console.log()
doesnât actually return a value.
The console is a nice place to try out JavaScript commands, but itâs not great if you want to make several lines of code (you can use shift+enter, but thatâs not great). Instead, go over to the Sources tab. On this page, you may have to look for the âSnippetsâ tab (next to Page, Filesystem, Overrides, Content scripts, Snippets, >>). Click on âNew snippetâ, and now you can create a JavaScript program, run it, and save it. The Run button is in the bottom right corner of the editor window (where your code is). You can save your code and name it too. It will probably be named âScript snippet #1â by default.
âFrankie