
  '==================
  'EXTRUDED POLYTOPES
  '==================

  'DOT LINE SQUARE CUBE HYPERCUBE ...

  double n1,n2,n3,l,f,s,v,g,h,d
  sys e
  string pr,tab,cr

  tab= chr 9
  cr=chr(13)+chr(10)

/*
  pr+="platonic solids" cr cr
  d=3    'dimensions
  df=2*d 'dimension factor
  e=2 'euler characteristic

  pr+="poly" tab "nodes" tab "edges" tab "faces"  tab "euler" cr

  for s=3 to 5 '2*3-1
    for n2=4 to 20 step 2 '2*3*4-4
      l=n2*d/2    'line
      f=n2*d/s    'share lines
      n1=l-f+e 'euler's rule
      if n1=n2 then
        pr+= s tab n1 tab  l tab f tab e cr
        if n1<>f then 'exclude self dual
          pr+= s tab f tab  l tab n1 tab e cr 'dual
        end if
        'it collect data for 4d
      end if
    next
  next

*/

  'dimensions d

  double p1,l1,f1,v1,h1,g1 'for tetrahedra
  double p2,l2,f2,v2,h2,g2 'for cubes
  double p,lf,ff,vf,hf,gf,nd

  pr+="platonic poly" cr cr
  pr+="dims" tab "nodes" tab "edges" tab "faces"  tab "vols" tab "4dcells" tab "5dcells" cr


  for d=0 to 7


  '
  'tet vs dimensions
  '
  p=p1+1
  l=p1+l1
  f=l1+f1
  v=f1+v1
  h=v1+h1
  g=h1+g1
  '
  'invariant factors
  '
  nd=p*d
  '
  if nd then
    lf=l*2/nd
    ff=f*3/nd
    vf=v*4/nd
    hf=h*5/nd
    gf=g*6/nd
  end if
  '
  e=d : e and= 1 : e+=e 'eular characeristic
  '
  'remember spec
  '
  p1=p
  l1=l
  f1=f
  v1=v
  h1=h
  g1=g

  'pr+= d tab p tab  l tab f tab v tab h tab g cr


  'cube based
  
  p=2^d
  nd=p*d
  l=nd*lf/2
  f=nd*ff/4
  v=nd*vf/8
  h=nd*hf/16
  g=nd*gf/32
  
  '
  /*
  p=2^d
  l=l2*2+p2
  f=f2*2+l2
  v=v2*2+f2
  h=h2*2+v2
  g=g2*2+h2
  p2=p
  l2=l
  f2=f
  v2=v
  h2=h
  g2=g
  */

  pr+= d tab p tab  l tab f tab v tab h tab g cr

  '

  next

  print pr

