digital literacy for everyone


[lit]

[generate-title]

[lit] although quasi was designed to teach 7 programming concepts, these concepts are common or illustrative to some degree in many, if not all programming languages. learning these concepts will help you understand python, bash, javascript and many others. [[variables]] | /input/ | [[output]] | [[basic-math]] | [[loops]] | [[conditionals]] | [[functions]] input refers to any task where data outside the program can get into the running program. the commands in programming languages can retrieve data from the keyboard, mouse, files, the network, or other peripheral devices. although every form of input (and every form of output) ultimately consists of numeric values, higher level languages like python, quasi and javascript can sometimes make it much easier for the coder to deal with such data. quasi is a very young language, and input methods are extremely limited. since part of the quasi interface is a small program editor, technically editing variable assignments is like "input", but thats not great. a recent feature added to quasi lets you get input from the url. while this isnt spectacular in terms of user friendliness, it counts as input and means you can create web links that include input for your quasi program. for example, if you bookmark or make a link that just says "hello", and link it to quasi 3.9 or later, command will let you access it: [url]https://codeinfig.neocities.org/quasi/quasi40.html?hello[url] now command will get the contents of the link after the question mark ? and store each item after it in the variable *now*. if you then output the contents, it will show the word "hello" on the screen. the *date* command is technically an input command as well. if you use the *date* command, you will get an array including the date, time and day of the week: now date you can use other commands to isolate the information you want from this array. apart from introducing quasis concept of input, these commands demonstrate a convention that adds to our concept of how the language works-- in the section on variables, we learned that you could set the value of a variable by providing a number or string: height get 5 firstname get "alan" in this section, instead of setting the variable on the left to a known value, we set the variable to the value that a quasi command provides-- either *date* for information from the system clock, or *command* for information included in the url linking to quasi. arrayfromclock date arrayfromurl command we learned about strings in the previous section, where we set firstname to the string "alan". in the examples of date and command, it actually sets the variable on the left to an array of strings. each item in the array is a separate string, which we can access individually or as a group. so far, we have learned how to set a variable and how to get information from a link and from the clock. these examples create data that the program has access to, but that isnt useful to us unless the program can [[output]] information as well. please note, that if you are reading these sections and expect to understand coding from them, you really should be entering the code into quasi and clicking *run program*. it is possible to learn how quasi works just in theory, just like you dont need to count beans or sticks to know that 2 + 2 = 4, but typing and running code is a far more powerful way to watch and learn what code does in practice, not just in theory. when you can watch the code working, it means far more to the learner than "this is how a program would work, if i actually ran it." you can run quasi here: [url]https://codeinfig.neocities.org/quasi/quasi40.html?here is some text[url] you can also right-click and download the above file; quasi is a single html file, with all the necessary program language implementation included. this means you can run quasi without an internet or network connection.
back to quasi concepts: [url]https://codeinfig.neocities.org/quasiconcepts/index.html[url] quasi main page: [url]https://codeinfig.neocities.org/quasi/index.html[url] home: [lit]https://codeinfig.neocities.org[lit]