View Problem

Define an initial map

Define the map {circle:1, triangle:3, square:4}
DiskEdit
python
shapes = {'circle': 1, 'square': 4, 'triangle': 2}
DiskEdit
clojure
(def m '{circle 1 triangle 1 square 4})
ExpandDiskEdit
fsharp
let shapes = Map.ofList [("circle", 1); ("triangle", 3); ("square", 4)]
ExpandDiskEdit
fsharp
let shapes = Map.empty.Add("circle", 1).Add("triangle", 3).Add("square", 4)
ExpandDiskEdit
fsharp
let shapes = new Generic.Dictionary<string, int>()
shapes.Add("circle", 1)
shapes.Add("triangle", 3)
shapes.Add("square", 4)
DiskEdit
fsharp
let shapes = Map [("circle", 1); ("triangle", 3); ("square", 4)]
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Hashtable^ shapes = gcnew Hashtable;

shapes->Add("circle", 1);
shapes->Add("triangle", 3);
shapes->Add("square", 4);
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Generic::Dictionary<String^, int>^ shapes = gcnew Generic::Dictionary<String^, int>();

shapes->Add("circle", 1);
shapes->Add("triangle", 3);
shapes->Add("square", 4);
ExpandDiskEdit
cpp
map<string, int> shapes;

shapes["circle"] = 1;
shapes["triangle"] = 3;
shapes["square"] = 4;

Submit a new solution for python, clojure, fsharp, or cpp
There are 24 other solutions in additional languages (erlang, fantom, go, groovy ...)