ArchLang Playground

Two-bed flat — an ArchLang floor plan example

A two-bedroom apartment with every room off a central corridor, its walls derived from the rooms — the plainest complete dwelling in the set.

This plan compiles to 5 rooms, 80 m² of floor area and 4 windows; every room is reachable from the entrance.

Kitchen / Living 32.0 m² Master Bedroom 21.6 m² Hall 8.4 m² Bathroom 7.2 m² Bedroom 2 10.8 m² 10300 8300 N 02 m PROJECTTwo-Bedroom FlatDRAWN BYArchCanvasDATE2026-06-25SCALE1:100
"Two-Bedroom Flat" — a 5-room floor plan, 80 m² total: Kitchen / Living (32 m²), Master Bedroom (21.6 m²), Hall (8.4 m²), Bathroom (7.2 m²), Bedroom 2 (10.8 m²); 4 doors, 4 windows, entrance via d_front.
Open in the editor

What this plan uses

The parts of the language this plan's source writes, each linked to its section of the language reference.

The source

This is the whole plan. The drawing above is what the compiler produced from it — nothing was drawn by hand.

# A two-bedroom apartment with a central corridor, written rooms first:
#   1. the rooms, the corridor among them (a corridor is a room);
#   2. `walls from rooms`, which derives the shell on their outline and a partition on
#      every shared edge, so no wall can go missing;
#   3. the openings, each hosted by the rooms it joins (`door between`, `on <room>.<edge>`);
#   4. the furniture.
# Every room opens off the hall, so no room is reached through a bedroom or the bath.
plan "Two-Bedroom Flat" {
  units mm
  grid 100
  scale 1:100
  north right

  room id=r_living at (0,0)       size 4000x8000 label "Kitchen / Living" uses kitchen living
  room id=r_bed1   at (4000,0)    size 6000x3600 label "Master Bedroom"
  room id=r_hall   at (4000,3600) size 6000x1400 label "Hall"
  room id=r_bath   at (4000,5000) size 2400x3000 label "Bathroom"
  room id=r_bed2   right-of r_bath align top size 3600x3000 label "Bedroom 2"

  # The hall runs into the living space with no door leaf: an opening across the whole
  # shared edge, stated rather than left as a gap.
  walls from rooms exterior 300 partition 100 { open between r_hall and r_living }

  # The front door at the hall's east end; every other room off the hall. A door says
  # where it stands (`at 1000 from start`: its centre, from the run's west end).
  door id=d_front on r_hall.right at center width 900 hinge near start swing into r_hall
  door between r_hall and r_bed1 at 1000 from start width 900 swing into r_bed1
  door between r_hall and r_bath at 1000 from start width 800 swing into r_bath
  door between r_hall and r_bed2 at 1000 from start width 900 swing into r_bed2

  window on r_living.top width 2000
  window on r_living.left at 5500 from start width 1500
  window on r_bed1.top at 2600 from end width 2400
  window on r_bed2.bottom width 1400

  # Beds with their heads on a wall; `flush` measures from the wall's inner face.
  furniture bed      in r_bed1 anchor top-left flush inset 300 size 1800x2100 label "Bed"
  furniture wardrobe in r_bed1 anchor top-right flush size 1200x600
  furniture bed      in r_bed2 anchor top-right flush size 1400x2000 label "Bed"
  furniture wardrobe in r_bed2 anchor bottom-left flush size 600x1200 rotate 270

  # Kitchen run along the west wall (the ring's segment 3, which runs from (0,8000) up to
  # (0,0)), clear of the window; the living half of the room takes a sofa and a table.
  furniture fridge       against wall exterior segment 3 offset 7500 size 600x700 in r_living
  furniture stove        against wall exterior segment 3 offset 5300 in r_living
  furniture kitchen_sink against wall exterior segment 3 offset 6100 in r_living
  furniture counter      against wall exterior segment 3 offset 6800 in r_living
  furniture sofa  at (2850,5400) size 900x2000 label "Sofa"  in r_living
  furniture table at (800,5800)  size 1200x800 label "Table" in r_living

  furniture shower in r_bath anchor bottom-left flush size 900x900
  furniture wc     against r_bath.bottom offset 1600 size 400x700
  furniture basin  in r_bath anchor right flush size 500x600

  # The eaves: the derived shell is the plan's one closed exterior ring.
  roof overhang 500

  # Overall extents, outside face to outside face: `faces` pushes each endpoint out
  # onto the wall it runs into, so the printed span is the true 10300 × 8300 the
  # building measures — the 10000 × 8000 room grid plus half the 300 shell at each end.
  # Exactly the arithmetic a hand-written `text` gets wrong.
  dim faces (0,8000)->(10000,8000) offset 700
  dim faces (0,0)->(0,8000) offset 700

  title {
    project "Two-Bedroom Flat"
    drawn_by "ArchCanvas"
    date "2026-06-25"
  }
}

More in Homes

Read more