Group Abstract Group Abstract

Message Boards Message Boards

1
|
925 Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Where is the error in this programming exercise?

I have been using the free online resource Elementary Introduction to the Wolfram Language for a number of years to introduce beginning biologists to the Wolfram Language. The text is a great resource, yet every year we get to Question 7.9 in Chapter 7, and my students (and me) get frustrated that the expected output does not match the output created by the answer keys own proposed solution.

See this screenshot: enter image description here

The only workaround I know of - and which I share with students - is to use a Graphics statement.

Is the problem with this question that the expected output is wrong OR should Style[Purple,100] produce the correct output but doesn't?

POSTED BY: Todd Allen
5 Replies
Posted 15 days ago

Thank you! I am confronting the same issue, using the online course environment.

Style[Purple,100] delivers a small (standard) purple swatch in a larger carriage-return area of empty space (I do not have the vocab to describe this area, but it looks like the empty space is sized for 100 point font).

Attachment

Attachments:
POSTED BY: Ellynne Dec

Thank you, Hans, for checking! Your results confirm that there is something wrong in the Wolfram Cloud. I will submit a formal bug report to Wolfram.

POSTED BY: Todd Allen
Posted 2 months ago

I can verify. On desktop 14.2 the size of the Style[Purple,100] square is as expected in the course. But very small in Wolfram Cloud on Firefox. I am using Windows 11.

POSTED BY: Hans Milton

Thank you for checking this code on your desktop, Gianluca.

I can verify your observations that the code works on the desktop (V14.2 Windows 10), which leads to the important realization that the code does not seem to work correctly on the cloud. I am accessing the Wolfram Cloud through a Google Chrome web browser on Windows Desktops with my students.

Can anyone else verify that the code in question does not work on the cloud?

POSTED BY: Todd Allen

On my desktop both

Style[Purple, 100]
Graphics[{Purple, Rectangle[]}, ImageSize -> 100]

work fine, although the latter comes out a bit larger.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard