Questions tagged [codeworld]

code.world - A programming playground for a language similar to Haskell.

CodeWorld is an educational environment using Haskell. It provides a simple mathematical model for geometric figures, animations, and interactive and multi-player games. The web-based programming environment supports this educational mission with a zero-setup editor and compiler, easy sharing and cloud storage of projects, and the ability to run programs right in the web browser using GHCJS.

Main Site: https://code.world

12 questions
3
votes
1 answer

circular segment in haskell CodeWorld

Could anyone tell me the best way to draw a circular segment using the haskell codeworld API? I have a method that works only when the circular segment is cut off below the radius by combining three sectors. However, this does not work in the case…
nlanson
  • 357
  • 1
  • 3
  • 14
2
votes
1 answer

How to animate something in Code World Haskell?

I am a new programmer and I am taking a high school course called Introduction to Computational Thinking. We are learning Haskell with Code World, an online IDE. Our assignment is to draw some kites and make them move around a little bit. However,…
2
votes
2 answers

How to combine simulated animation with graphs in CodeWorld?

I play with CodeWorld and use the "entrypoint" activityOf() to simulate a physical system consisting of tanks. Here we have one tank with an outlet flow qout(h) that depends on the height of volume level. Of course, for serious simulation work one…
janpeter
  • 681
  • 8
  • 22
2
votes
0 answers

How to draw an ellipse in codeworld haskell given co-ordinates

I need to draw an ellipse given two co-ordinates Ellipse Coords Coords but i'm not sure how to do this with vertices, co-vertices, foci, and a centre point. I'm basically confused as to which points go into the two co-ordinates. I have…
CB010101
  • 63
  • 3
2
votes
1 answer

ellipse in haskell CodeWorld

Can anyone tell me how to draw an Ellipse using the CodeWorld package of Haskell? I want it to be like the rectangle function where I give two arguments for length and width. I have tried using solidClosedCurve-am I heading in the right direction?
Amy
  • 31
  • 3
1
vote
0 answers

Trying to port Bad Apple!! onto Haskell

I'm a first year Computer Science Student in my first semester of Haskell. We have recently been doing a lot of work with Code World (a package used for drawing pictures in Haskell) and I was wondered we can port Bad Apple!! onto Haskell using Code…
1
vote
2 answers

How to match constructor with codeworld function haskell

so I've looked around for hours and can't find an answer to match what I need, although many are along the same line so I'm sorry if this is somehow a repost. In haskell, I have this shapeToPicture :: Shape -> Picture shapeToPicture (Line p1 p2) …
CB010101
  • 63
  • 3
1
vote
1 answer

How do you debug in codeworld?

In http://codeworld.info/, you can only draw/print/display data in types of Text and Number (and you need Show to convert Number to Text). So what can I do to let codeworld draw something that is neither a Text or Number?
Alic
  • 638
  • 6
  • 27
0
votes
1 answer

How to structure the state in activityOf() in CodeWorld?

I explore the usage of activityOf(state_0, change, picture) in CodeWorld framework. The state is described as a tuple. I test the possibility to let one of the elements in the tuple to be a list, since I think that would be very useful and make…
janpeter
  • 681
  • 8
  • 22
0
votes
1 answer

How to combine activityOf() controlled by both TimePassing() and Event in CodeWorld?

I want to control a simulated physical process by increasing/decreasing some variables using the keyboard or pointer. What I can see you must choose either TimePassing() or KeyPress() etc for change(). And I can understand you need two parallel…
janpeter
  • 681
  • 8
  • 22
0
votes
1 answer

Koch snowflake in Haskell (CodeWorld)

Through the Haskell package, CodeWorld (https://hackage.haskell.org/package/codeworld-api) , I need to draw Koch's snowflake. You can use this package online, in case you don't want to download it: https://code.world/# A link so you can see what I…
user9183739
-1
votes
1 answer

How to create a function that graphs objects in haskell in Haskell

How to Format ► put returns between paragraphs ► for linebreak add 2 spaces at end ► italic or bold ► indent code by 4 spaces
Mikhail
  • 77
  • 6