

This forces connections into arbitrary knots and loops, creating more tangles and going against the overall flow. The problem these examples have is that, although visual, they slavishly adhere to an imperative style of coding where instructions are listed in order and even the words within each instruction must follow a specific syntax. Reaching elbow deep into a rat’s nest of wires is not anything like shaping clay.īut it doesn’t have to be this bad. Stringing wires or snapping bricks gets really messy really fast. I think it’s easy to see at a glance the problem with this approach: it doesn’t scale. The others let you drag boxes around and string wires between them. Scratch) let you snap together commands like Lego bricks. The image above includes some typical examples. Instead of typing instructions, you drag objects around and connect them together to express ideas.Ĭlockwise from upper left: Origami (Quartz Composer), Coral, Scratch, Form In theory, any written language can instead be represented as a collection of elements arranged and connected in space this is the idea behind visual programming languages. Traditional programming languages are frustrating for visual thinkers they rely on a phonological style which uses hands only to type and eyes only to read. “With my hands” refers to a kinesthetic or visuospatial style of thinking which leverages our ability to perceive and manipulate spatial relationships.
#Nodebox usage series#
There is no need to write a series of instructions and then “run” them to see what happens instead every change you make instantly affects the outcome. A familiar example is the spreadsheet: change a single cell and the rest of the sheet automatically updates. There are two key concepts here: “continuously shape” and “with my hands.”Ĭode that is continuously shaped is called reactive programming.


“I want to grab a clump of clay and just continuously shape it with my hands until I am satisfied.” I said I wanted a process less like solving a Rubik’s cube and more like throwing a pot. Using these more basic tools may make your problem easier to solve.In my previous post I argued that the hunt is on for a better way to code, a way more suited for a designer’s need to test new interactions. You can do this with the float() function: rect ( float (row ), float (row ), float (row ), float (row ) )I'm not sure I can do much more for you, but one last note: The Python tutorial might also help you, despite its being kind of a heavy read: a file object, which you get when you call open(): f = open ( "table.csv" )can give you each of its lines without your having to use csv.reader, and a string can separate itself using a delimiter that you pick (like ", #, "). Once you figure the locations out, you'll need to convert them so that NodeBox will use them as numbers.

If that was a line from your file, the data in row would look like this: and when you run those three print statements above you'll get: '25' ' #' ' 35'This is really the only problem you face: where are the items that you want located in the list called "row"? You've gotten most of the way there. This is why I suggest printing out the entirety of row to see what it looks like. If there are other items on the line, like this: 25, #, 35, #, 45, #, 55then you're going to have to figure out what position they are in and access the list around them. The important thing, since you are using the "comma-separated-values" (csv) module, is that the commas are separating the items that you want, and even more, that there isn't anything else on each line. To get each string, you access the list, which you have named "row": print row print row print row resulting in this output '25' ' 35' ' 45'It's not important what the strings actually are. There are NodeBox tutorials about these types of data which you should check out. I'm going to assume that the first few lines in your file look something like this: 25, 35, 45, 55 10, 15, 60, 65 75, 30, 95, 40The data that you get each time through the for loop looks like this: This is a "list" made up of four "strings". It's difficult, like I said, to know exactly what you need to do without seeing a few example lines from your data file, but let me give you a made-up example and then you should be able to go back to your file and figure it out. What you are trying to do makes sense, and is straightforward.
