inform7

Is there another way to write tables in Inform 7?


Inform 7 tables are written using "tab separated values". Whenever a table contains text, it ends up looking like this:

Table of Aristotelian Questions
name    difficulty  text    explanation follow-up
the opposite question   easy    "WHAT IS THE OPPOSITE OF [the subject]?[line break]"    "SOMETIMES A GOOD WAY TO DESCRIBE SOMETHING IS BY TELLING[line break]WHAT IT IS NOT.  THERE MAY OR MAY NOT BE A DIRECT[line break]OPPOSITE OF [the subject], BUT[line break]SEE IF YOU CAN THINK OF ONE.[line break][line break]FOR EXAMPLE, IF I WERE WRITING A PAPER ON SOLAR[line break]ENERGY, AN ANSWER TO THIS QUESTION MIGHT PRODUCE A[line break]LIST OF EARTH'S NATURAL ENERGY RESOURCES.[line break]" prompt A
the good consequences question  easy    "WHAT ARE THE GOOD CONSEQUENCES OF[line break][the subject]?[line break]"   "WHAT GOOD WILL COME ABOUT FROM MANKIND'S CONCERN ABOUT[line break][the subject]?[line break][line break]FOR EXAMPLE, IF I WERE WRITING A PAPER ABOUT COLLEGE[line break]ACADEMICS, SOME OF THE GOOD CONSEQUENCES MAY BE A BETTER[line break]JOB IN THE FUTURE, A FULLER UNDERSTANDING[line break]ABOUT OUR WORLD, AND AN APPRECIATION FOR GOOD STUDY HABITS.[line break](STOP THE SNICKERING AND GET ON WITH AN ANSWER.)[line break]"  prompt C

Is there another way to write the same table? (I'm imagining something sort of YAML-like.)


Solution

  • No, that's the only way to make a table in I7. But you can extract all of the text as constants:

    Table of Aristotelian Questions
    name    difficulty  text    explanation follow-up
    the opposite question   easy    Opposite question   Opposite follow up  prompt A
    the good consequences question  easy    Good question   Good follow up  prompt C
    
    Opposite question is always "WHAT IS THE OPPOSITE OF [the subject]?[line break]".
    Opposite follow up is always "SOMETIMES A GOOD WAY TO DESCRIBE SOMETHING IS BY TELLING[line break]WHAT IT IS NOT.  THERE MAY OR MAY NOT BE A DIRECT[line break]OPPOSITE OF [the subject], BUT[line break]SEE IF YOU CAN THINK OF ONE.[line break][line break]FOR EXAMPLE, IF I WERE WRITING A PAPER ON SOLAR[line break]ENERGY, AN ANSWER TO THIS QUESTION MIGHT PRODUCE A[line break]LIST OF EARTH'S NATURAL ENERGY RESOURCES.[line break]".
    Good question is always "WHAT ARE THE GOOD CONSEQUENCES OF[line break][the subject]?[line break]".
    Good follow up is always "WHAT GOOD WILL COME ABOUT FROM MANKIND'S CONCERN ABOUT[line break][the subject]?[line break][line break]FOR EXAMPLE, IF I WERE WRITING A PAPER ABOUT COLLEGE[line break]ACADEMICS, SOME OF THE GOOD CONSEQUENCES MAY BE A BETTER[line break]JOB IN THE FUTURE, A FULLER UNDERSTANDING[line break]ABOUT OUR WORLD, AND AN APPRECIATION FOR GOOD STUDY HABITS.[line break](STOP THE SNICKERING AND GET ON WITH AN ANSWER.)[line break]".