Function Repository Resource:

DienesBlock

Source Notebook

Create a Dienes block visualization of an integer in any base

Contributed by: Alec Titterton

ResourceFunction["DienesBlock"][n]

creates a grid of graphics of the digits of the integer n in the style of Dienes blocks.

Details and Options

Dienes blocks (named after their creator, mathematician and educationalist Zoltán Pál Dienes), are a mathematical manipulative used by students to learn basic mathematical concepts including addition, subtraction, number sense, place value and counting.
Integers above 9999 will only display the last four digits in the graphics.
Negative signs are ignored.
ResourceFunction["DienesBlock"] takes the following options:
"ShowDigits"Falsedisplay the individual digit numerals underneath the blocks
"Base"10the base to use
"FaceColors"{Lighter[Red,0.7],LightBlue,LightGreen,Yellow}colors of the block faces in order
"EdgeColors"GrayLevel[0.6]colors of the edges and grid lines on the blocks
The result of ResourceFunction["DienesBlock"] is a Grid.

Examples

Basic Examples (1) 

Display the base 10 visualisation of 1234:

In[1]:=
ResourceFunction["DienesBlock"][1234]
Out[1]=

Scope (1) 

Negative signs are ignored:

In[2]:=
ResourceFunction["DienesBlock"][-507, "ShowDigits" -> True]
Out[2]=

Options (3) 

Base (1) 

Change the base:

In[3]:=
ResourceFunction["DienesBlock"][3124, "Base" -> 5, "ShowDigits" -> True]
Out[3]=

FaceColors (1) 

Change the colors:

In[4]:=
ResourceFunction["DienesBlock"][2596, "FaceColors" -> {GrayLevel[1], GrayLevel[7], GrayLevel[0.35], GrayLevel[0.1]}, "EdgeColors" -> ConstantArray[Green, 4]]
Out[4]=

ShowDigits (1) 

Display the digits:

In[5]:=
ResourceFunction["DienesBlock"][3709, "ShowDigits" -> True]
Out[5]=

Applications (1) 

Create quizzes on Dienes blocks:

In[6]:=
QuestionObject[
 Column[{"What number is this representing?", ResourceFunction["DienesBlock"][1283]}], AssessmentFunction[1283]]
Out[6]=
In[7]:=
QuestionObject[
 Column[{"What is the answer to this calculation?", "Ninety seven minus fifty one", Row[{ ResourceFunction["DienesBlock"][97], Style["  -  ", 30], ResourceFunction["DienesBlock"][51]}]}], AssessmentFunction[46]]
Out[7]=

Publisher

Alec Titterton

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.0 – 03 April 2024

Related Resources

Author Notes

No option to control the sizes at the moment but it's an easy addition

License Information