<p>Code.org has a CS Principles curriculum available for free, and I think this would meet your needs.  <a href="https://studio.code.org/courses/csp" rel="nofollow noreferrer">https://studio.code.org/courses/csp</a></p>

<p>I've never used it with a class, but it starts with an implementation of blockly (<a href="https://developers.google.com/blockly/" rel="nofollow noreferrer">https://developers.google.com/blockly/</a>) and transitions to Javascript in Units 3 and 5.  It also allows students to create apps, using AppLab.  It starts with a turtle and moves through to user interfaces and beyond.</p>

CC BY-SA 3.0
2017-06-16T19:19:59.837Z
2017-06-16T19:19:59.837Z
Lisa Hines
<p>Not strictly block based, but I like <a href="http://codesters.com" rel="nofollow noreferrer">Codesters</a> as a nice midway point. It has a DnD interface but the blocks you drop become Python code.</p>

CC BY-SA 3.0
2017-06-15T18:17:14.070Z
2017-06-15T18:17:14.070Z
Mike Zamansky
<p>While I definitely recommend Snap!, for completeness sake you might take a look at:</p>

<ul>
<li>Scratch -- though w/o custom functions this may be limiting</li>
<li>PencilCode -- a blocks+text environment around CoffeeScript</li>
<li>GP (gpblocks.org) -- a desktop environment that looks similar to Scratch/Snap! But has dozens more blocks as well as a very interesting model for exploring classes and inheritance. </li>
<li>AppInventor -- using blocks to build Android apps.</li>
</ul>

<p>For me, Snap! strikes a good middle ground between freedom and complexity. </p>

CC BY-SA 3.0
2017-08-09T07:57:39.117Z
Welcome to [cseducators.se]! This answer could really benefit from explanations on why Snap! might be a good option.
ItamarG3
CC BY-SA 3.0
2017-08-09T15:09:05.883Z
Also, feel free to come by [The Classroom](https://chat.stackexchange.com/rooms/59174/the-classroom) and say hi. That's where we all tend to hang out. ;-)
Ben I.
CC BY-SA 3.0
2017-08-09T07:53:56.573Z
2017-08-09T07:53:56.573Z
Cycomachead
<p>On <a href="http://codehs.com" rel="nofollow noreferrer">CodeHS</a> we have a block-to-text based programming environment and a full curriculum for <a href="https://codehs.com/info/curriculum/apcsp" rel="nofollow noreferrer">AP CS Principles</a> that you can use for JavaScript. It has a unit to teach JavaScript, including functions and lists among other topics, and also starts with a unit on Karel the Dog. Karel the Dog is a JavaScript implementation of the <a href="https://en.wikipedia.org/wiki/Karel_(programming_language)" rel="nofollow noreferrer">Karel programming language</a>, which is very similar to the style of problems on the AP CSP exam. Karel knows the commands</p>

<p><code>move();</code>
<code>putBall();</code>
<code>takeBall()</code>;
<code>turnLeft()</code>; and later <code>turnAround();</code></p>

<p>Essentially it is the same as 2D robot programming but with a dog instead of a robot, which is a bit friendlier. </p>

<p>You can use this with blocks or text - it's just in JavaScript, and you or students can also easily build their own worlds. Hope that helps!</p>

CC BY-SA 3.0
2017-06-15T23:27:33.803Z
2017-06-15T23:27:33.803Z
jkeesh
<p><a href="http://www.slnova.org/" rel="nofollow noreferrer">StarLogo Nova</a> is another MIT project. It's block based like scratch, but I personally find it much nicer to use, and it allows (I think) for more complex programs. It is more simulation oriented than scratch, but you can still make just about anything with it. Also, it has a flying turtle for a logo:</p>

<p><a href="https://i.sstatic.net/MDNB0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MDNB0.png" alt="enter image description here"></a></p>

<p>It's got a nice setup for classes - each user has a profile with a public and a private gallery. You can add collaborators to projects, set up some form of "class" on the system, though I don't know quite what that entails, etc. </p>

<p>Here's a screenshot of the coding environment with some code for a project I did in it:</p>

<p><a href="https://i.sstatic.net/54YRI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/54YRI.png" alt="enter image description here"></a></p>

<p>On the left, you have a menu with the different coding blocks, the drop down has categories very similar to those in scratch. The tabs on top of the coding section are basically for the different "agents" and for the "world". This program, if you're wondering why there's a "Killers" tab, is to simulate an epidemic. There's support for all sorts of things - procedures that return values, movement of "turtles" which are basically robots on the screen, etc. </p>

<p>Here's a screenshot of the section of the screen that shows the result of your program:</p>

<p><a href="https://i.sstatic.net/ayvyv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ayvyv.png" alt="enter image description here"></a></p>

<p>This shows the level of complexity you can get too - you can have output graphs and number boxes, input sliders, etc. You can also keep it very simple - the two things that are pretty much always there are the "setup" and "forever" buttons. This screenshot was taken right after "setup" was pressed - it initialized the turtles, widgets, breeds in the right proportions, etc. </p>

<p>I'd definitely recommend this language.</p>

CC BY-SA 3.0
2017-06-18T17:01:22.197Z
2017-06-18T17:01:22.197Z
auden
<p>Python has a turtle graphics module that is quite a bit of fun to play around with.   It is simple to use and you can have your students write functions to drive it and to draw custom graphical elements such as stars. </p>

<p>Turtle graphics can be used to make looping visual.  You can also add an event-driven element by making your drawing panels mouse-sensitive.   The Python site has complete documentation.  Tough exercise: Draw an American flag.  Easier: Draw a Texas flag; making a five-sided star is a fun puzzle. </p>

<p>You can incorporate this into your class and experiment with it a variety of levels.  </p>

CC BY-SA 3.0
2017-06-20T21:52:56.227Z
2017-06-20T21:52:56.227Z
ncmathsadist
<p>You will probably want to look into <a href="http://snap.berkeley.edu" rel="noreferrer">Snap!</a>. It was built upon Scratch and would probably meet your needs. This is from its About page:</p>

<blockquote>
  <p>Snap! (formerly BYOB) is a visual, drag-and-drop programming language.
  It is an extended reimplementation of Scratch (a project of the
  Lifelong Kindergarten Group at the MIT Media Lab) that allows you to
  Build Your Own Blocks. It also features first class lists, first
  class procedures, and continuations. These added capabilities make
  it suitable for a serious introduction to computer science for high
  school or college students.</p>
</blockquote>

<p>Additionally, I asked a question a few weeks ago about the differences between Scratch and Snap!. You might find this discussion helpful: <a href="https://cseducators.stackexchange.com/questions/112/what-can-snap-do-that-scratch-cannot">"What can Snap! do that Scratch cannot?"</a></p>

<p><strong>Edit</strong>: In the context of AP CS Principles, it may also be helpful to know there is a full curriculum available from Berkeley that utilizes Snap!. It is called <a href="http://bjc.berkeley.edu/" rel="noreferrer">The Beauty and Joy of Computing</a>.</p>

CC BY-SA 3.0
2017-06-15T17:57:23.267Z
yes snap. I have heard that it is used to teach first your undergrad. It certainly seems to have all the features needed. Even lambdas. If is a proper functional programming language (like lisp).
ctrl-alt-delor
CC BY-SA 3.0
2017-06-15T18:07:15.313Z
There is also Blockly, but I haven't used it before, so I can't vouch for it.
Peter
CC BY-SA 3.0
2017-06-20T23:14:58.093Z
@Peter Blockly (which I worked on) is really an editor, not a language. Languages can be built on top of it, as App Inventor is.
Ellen Spertus
CC BY-SA 3.0
2017-06-15T17:07:45.010Z
2017-06-15T18:06:24.767Z
2017-06-15T18:06:24.767Z
Peter
<p>This question is specific for teachers of the United States College Board's AP Computer Science Principles class.</p>

<p>I'm looking for a block based programming language that allows for:</p>

<ul>
<li>Procedures that return values</li>
<li>For each that will iterate through lists</li>
</ul>

<p>In addition, we are to teach basic 2D robot programming with commands such as TURN_AROUND(), MOVE(), TURN_RIGHT() etc.</p>

<p>My research has come up with <a href="https://scratch.mit.edu/" rel="noreferrer">MIT's Scratch IDE</a>; but I was wondering if there is a better choice for high school students.</p>

CC BY-SA 3.0
2017-06-15T18:01:06.743Z
There is no such thing as a procedure that returns something. Procedures are subroutines that do something. A function is a subroutine that has no side effects and returns something. (except that they do not need to be implemented with subroutines, it is the behaviour that matters.) Though these terms are often mixed up, and I know of no language that 100% enforces the separation (command/query separation).
ctrl-alt-delor
CC BY-SA 3.0
2017-06-15T18:17:16.300Z
@richard A pure function has no side effects. Most (all?) non-functional programming languages don't enforce purity of functions, so you'll find plenty that have side effects (but still return stuff).
JAB
CC BY-SA 3.0
2017-06-15T21:03:53.903Z
Though Scratch might seem a little juvenile for high school students, if you can overcome the students' initial distaste for something that appears to be tailored towards younger children, Scratch can truly be a powerful tool to teach. I've seen Scratch successfully illustrate complicated concepts in CS principles on multiple occasions.
Sam Weaver
CC BY-SA 3.0
2017-06-15T21:27:36.700Z
@jab yes “I know of no language that 100% enforces the separation”
ctrl-alt-delor
<block-based-programming><ap-cs-principles>
Looking for a block-based programming language for AP CS P
# Looking for a block-based programming language for AP CS P

(Asked by: username_0 on 2017-06-15)

This question is specific for teachers of the United States College Board's AP Computer Science Principles class.

I'm looking for a block based programming language that allows for:

* Procedures that return values
* For each that will iterate through lists

In addition, we are to teach basic 2D robot programming with commands such as TURN\_AROUND(), MOVE(), TURN\_RIGHT() etc.

My research has come up with [MIT's Scratch IDE](https://scratch.mit.edu/); but I was wondering if there is a better choice for high school students.

**Tags:** block-based-programming, ap-cs-principles

> **Comments:**
> **username_1**: There is no such thing as a procedure that returns something. Procedures are subroutines that do something. A function is a subroutine that has no side effects and returns something. (except that they do not need to be implemented with subroutines, it is the behaviour that matters.) Though these terms are often mixed up, and I know of no language that 100% enforces the separation (command/query separation).  
> **username_2**: @richard A pure function has no side effects. Most (all?) non-functional programming languages don't enforce purity of functions, so you'll find plenty that have side effects (but still return stuff).  
> **username_3**: Though Scratch might seem a little juvenile for high school students, if you can overcome the students' initial distaste for something that appears to be tailored towards younger children, Scratch can truly be a powerful tool to teach. I've seen Scratch successfully illustrate complicated concepts in CS principles on multiple occasions.  
> **username_1**: @jab yes “I know of no language that 100% enforces the separation”  

---

## 7 answers

### Answer by username_12 on 2017-06-15. Score: 11

You will probably want to look into [Snap!](http://snap.berkeley.edu). It was built upon Scratch and would probably meet your needs. This is from its About page:

> Snap! (formerly BYOB) is a visual, drag-and-drop programming language.
> It is an extended reimplementation of Scratch (a project of the
> Lifelong Kindergarten Group at the MIT Media Lab) that allows you to
> Build Your Own Blocks. It also features first class lists, first
> class procedures, and continuations. These added capabilities make
> it suitable for a serious introduction to computer science for high
> school or college students.

Additionally, I asked a question a few weeks ago about the differences between Scratch and Snap!. You might find this discussion helpful: ["What can Snap! do that Scratch cannot?"](https://cseducators.stackexchange.com/questions/112/what-can-snap-do-that-scratch-cannot)

**Edit**: In the context of AP CS Principles, it may also be helpful to know there is a full curriculum available from Berkeley that utilizes Snap!. It is called [The Beauty and Joy of Computing](http://bjc.berkeley.edu/).

> **Comments:**
> **username_1**: yes snap. I have heard that it is used to teach first your undergrad. It certainly seems to have all the features needed. Even lambdas. If is a proper functional programming language (like lisp).  
> **username_12**: There is also Blockly, but I haven't used it before, so I can't vouch for it.  
> **username_13**: @username_12 Blockly (which I worked on) is really an editor, not a language. Languages can be built on top of it, as App Inventor is.  

---

### Answer by username_4 on 2017-06-16. Score: 2

Code.org has a CS Principles curriculum available for free, and I think this would meet your needs. <https://studio.code.org/courses/csp>

I've never used it with a class, but it starts with an implementation of blockly (<https://developers.google.com/blockly/>) and transitions to Javascript in Units 3 and 5. It also allows students to create apps, using AppLab. It starts with a turtle and moves through to user interfaces and beyond.


---

### Answer by username_5 on 2017-06-15. Score: 2

Not strictly block based, but I like [Codesters](http://codesters.com) as a nice midway point. It has a DnD interface but the blocks you drop become Python code.


---

### Answer by username_6 on 2017-08-09. Score: 2

While I definitely recommend Snap!, for completeness sake you might take a look at:

* Scratch -- though w/o custom functions this may be limiting
* PencilCode -- a blocks+text environment around CoffeeScript
* GP (gpblocks.org) -- a desktop environment that looks similar to Scratch/Snap! But has dozens more blocks as well as a very interesting model for exploring classes and inheritance.
* AppInventor -- using blocks to build Android apps.

For me, Snap! strikes a good middle ground between freedom and complexity.

> **Comments:**
> **username_7**: Welcome to [cseducators.se]! This answer could really benefit from explanations on why Snap! might be a good option.  
> **username_8**: Also, feel free to come by [The Classroom](https://chat.stackexchange.com/rooms/59174/the-classroom) and say hi. That's where we all tend to hang out. ;-)  

---

### Answer by username_9 on 2017-06-15. Score: 1

On [CodeHS](http://codehs.com) we have a block-to-text based programming environment and a full curriculum for [AP CS Principles](https://codehs.com/info/curriculum/apcsp) that you can use for JavaScript. It has a unit to teach JavaScript, including functions and lists among other topics, and also starts with a unit on Karel the Dog. Karel the Dog is a JavaScript implementation of the [Karel programming language](https://en.wikipedia.org/wiki/Karel_(programming_language)), which is very similar to the style of problems on the AP CSP exam. Karel knows the commands

`move();`
`putBall();`
`takeBall()`;
`turnLeft()`; and later `turnAround();`

Essentially it is the same as 2D robot programming but with a dog instead of a robot, which is a bit friendlier.

You can use this with blocks or text - it's just in JavaScript, and you or students can also easily build their own worlds. Hope that helps!


---

### Answer by username_10 on 2017-06-18. Score: 0

[StarLogo Nova](http://www.slnova.org/) is another MIT project. It's block based like scratch, but I personally find it much nicer to use, and it allows (I think) for more complex programs. It is more simulation oriented than scratch, but you can still make just about anything with it. Also, it has a flying turtle for a logo:

[![enter image description here](https://i.sstatic.net/MDNB0.png)](https://i.sstatic.net/MDNB0.png)

It's got a nice setup for classes - each user has a profile with a public and a private gallery. You can add collaborators to projects, set up some form of "class" on the system, though I don't know quite what that entails, etc.

Here's a screenshot of the coding environment with some code for a project I did in it:

[![enter image description here](https://i.sstatic.net/54YRI.png)](https://i.sstatic.net/54YRI.png)

On the left, you have a menu with the different coding blocks, the drop down has categories very similar to those in scratch. The tabs on top of the coding section are basically for the different "agents" and for the "world". This program, if you're wondering why there's a "Killers" tab, is to simulate an epidemic. There's support for all sorts of things - procedures that return values, movement of "turtles" which are basically robots on the screen, etc.

Here's a screenshot of the section of the screen that shows the result of your program:

[![enter image description here](https://i.sstatic.net/ayvyv.png)](https://i.sstatic.net/ayvyv.png)

This shows the level of complexity you can get too - you can have output graphs and number boxes, input sliders, etc. You can also keep it very simple - the two things that are pretty much always there are the "setup" and "forever" buttons. This screenshot was taken right after "setup" was pressed - it initialized the turtles, widgets, breeds in the right proportions, etc.

I'd definitely recommend this language.


---

### Answer by username_11 on 2017-06-20. Score: 0

Python has a turtle graphics module that is quite a bit of fun to play around with. It is simple to use and you can have your students write functions to drive it and to draw custom graphical elements such as stars.

Turtle graphics can be used to make looping visual. You can also add an event-driven element by making your drawing panels mouse-sensitive. The Python site has complete documentation. Tough exercise: Draw an American flag. Easier: Draw a Texas flag; making a five-sided star is a fun puzzle.

You can incorporate this into your class and experiment with it a variety of levels.


---

