Skip to main content
Add header with total byte count, improved capitalization
Source Link
ProgramFOX
  • 8.3k
  • 7
  • 45
  • 70

JavaScript + HTML, 3909 bytes

This is a htmlHTML/javascriptJavaScript application that uses page reload to rerun files. I goofed on parsing the ppmPPM. If you know how to read ppmPPM files, please let me know. Stack-exchange Exchange doesn't allow local-storage. So you will have to run the JSFiddle.

Again, iI know iI bombed the ppm file.

But in the end:

JavascriptJavaScript: 1,232 bytes * 3 = 3696

HTML: 71 bytes * 3 = 213

Total: 3909

JSFiddle

var mary = '</br>\
Mary had a little lamb,</br>\
Little lamb, little lamb,</br>\
Mary had a little lamb,</br>\
Its fleece was white as snow</br>\
</br>\
And everywhere that Mary went,</br>\
Mary went, Mary went,</br>\
Everywhere that Mary went</br>\
The lamb was sure to go</br>\
</br>\
It followed her to school one day</br>\
School one day, school one day</br>\
It followed her to school one day</br>\
Which was against the rules.</br>\
</br></br>\
It made the children laugh and play,</br>\
Laugh and play, laugh and play,</br>\
It made the children laugh and play</br>\
To see a lamb at school\
';
var img = '<img src="https://i.sstatic.net/sHCba.png"/>'

function run() {
  var step = localStorage.getItem("step");
  step++;
  localStorage.setItem("step", step);
  $('#step').text(step);
  var r = $('#results')
  switch (step) {
    case 1:
      for (var i = 0; i < 133; i++) {
        r.append(i + 1 + ' ');
      }
      break;
    case 2:
      r.html(mary);
      break;
    case 3:
      r.html(img);
      localStorage.setItem("step", 0);
      break;
    default:
      localStorage.setItem("step", 0);
      break;
  }
}
run();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>Step: <span id='step'></span>
</label>
<div id='results'></div>

This is a html/javascript application that uses page reload to rerun files. I goofed on parsing the ppm. If you know how to read ppm files, please let me know. Stack-exchange doesn't allow local-storage. So you will have to run the JSFiddle.

Again, i know i bombed the ppm file.

But in the end:

Javascript: 1,232 bytes * 3 = 3696

HTML: 71 bytes * 3 = 213

Total: 3909

JSFiddle

var mary = '</br>\
Mary had a little lamb,</br>\
Little lamb, little lamb,</br>\
Mary had a little lamb,</br>\
Its fleece was white as snow</br>\
</br>\
And everywhere that Mary went,</br>\
Mary went, Mary went,</br>\
Everywhere that Mary went</br>\
The lamb was sure to go</br>\
</br>\
It followed her to school one day</br>\
School one day, school one day</br>\
It followed her to school one day</br>\
Which was against the rules.</br>\
</br></br>\
It made the children laugh and play,</br>\
Laugh and play, laugh and play,</br>\
It made the children laugh and play</br>\
To see a lamb at school\
';
var img = '<img src="https://i.sstatic.net/sHCba.png"/>'

function run() {
  var step = localStorage.getItem("step");
  step++;
  localStorage.setItem("step", step);
  $('#step').text(step);
  var r = $('#results')
  switch (step) {
    case 1:
      for (var i = 0; i < 133; i++) {
        r.append(i + 1 + ' ');
      }
      break;
    case 2:
      r.html(mary);
      break;
    case 3:
      r.html(img);
      localStorage.setItem("step", 0);
      break;
    default:
      localStorage.setItem("step", 0);
      break;
  }
}
run();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>Step: <span id='step'></span>
</label>
<div id='results'></div>

JavaScript + HTML, 3909 bytes

This is a HTML/JavaScript application that uses page reload to rerun files. I goofed on parsing the PPM. If you know how to read PPM files, please let me know. Stack Exchange doesn't allow local-storage. So you will have to run the JSFiddle.

Again, I know I bombed the ppm file.

But in the end:

JavaScript: 1,232 bytes * 3 = 3696

HTML: 71 bytes * 3 = 213

Total: 3909

JSFiddle

var mary = '</br>\
Mary had a little lamb,</br>\
Little lamb, little lamb,</br>\
Mary had a little lamb,</br>\
Its fleece was white as snow</br>\
</br>\
And everywhere that Mary went,</br>\
Mary went, Mary went,</br>\
Everywhere that Mary went</br>\
The lamb was sure to go</br>\
</br>\
It followed her to school one day</br>\
School one day, school one day</br>\
It followed her to school one day</br>\
Which was against the rules.</br>\
</br></br>\
It made the children laugh and play,</br>\
Laugh and play, laugh and play,</br>\
It made the children laugh and play</br>\
To see a lamb at school\
';
var img = '<img src="https://i.sstatic.net/sHCba.png"/>'

function run() {
  var step = localStorage.getItem("step");
  step++;
  localStorage.setItem("step", step);
  $('#step').text(step);
  var r = $('#results')
  switch (step) {
    case 1:
      for (var i = 0; i < 133; i++) {
        r.append(i + 1 + ' ');
      }
      break;
    case 2:
      r.html(mary);
      break;
    case 3:
      r.html(img);
      localStorage.setItem("step", 0);
      break;
    default:
      localStorage.setItem("step", 0);
      break;
  }
}
run();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>Step: <span id='step'></span>
</label>
<div id='results'></div>

Source Link
Roger
  • 101
  • 1

This is a html/javascript application that uses page reload to rerun files. I goofed on parsing the ppm. If you know how to read ppm files, please let me know. Stack-exchange doesn't allow local-storage. So you will have to run the JSFiddle.

Again, i know i bombed the ppm file.

But in the end:

Javascript: 1,232 bytes * 3 = 3696

HTML: 71 bytes * 3 = 213

Total: 3909

JSFiddle

var mary = '</br>\
Mary had a little lamb,</br>\
Little lamb, little lamb,</br>\
Mary had a little lamb,</br>\
Its fleece was white as snow</br>\
</br>\
And everywhere that Mary went,</br>\
Mary went, Mary went,</br>\
Everywhere that Mary went</br>\
The lamb was sure to go</br>\
</br>\
It followed her to school one day</br>\
School one day, school one day</br>\
It followed her to school one day</br>\
Which was against the rules.</br>\
</br></br>\
It made the children laugh and play,</br>\
Laugh and play, laugh and play,</br>\
It made the children laugh and play</br>\
To see a lamb at school\
';
var img = '<img src="https://i.sstatic.net/sHCba.png"/>'

function run() {
  var step = localStorage.getItem("step");
  step++;
  localStorage.setItem("step", step);
  $('#step').text(step);
  var r = $('#results')
  switch (step) {
    case 1:
      for (var i = 0; i < 133; i++) {
        r.append(i + 1 + ' ');
      }
      break;
    case 2:
      r.html(mary);
      break;
    case 3:
      r.html(img);
      localStorage.setItem("step", 0);
      break;
    default:
      localStorage.setItem("step", 0);
      break;
  }
}
run();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>Step: <span id='step'></span>
</label>
<div id='results'></div>