Change HTML4 entities to HTML5

&lt to <
&gt to >
&amp to &
This commit is contained in:
James Gregory 2013-12-30 14:33:39 +11:00
commit b8e7ce7165
105 changed files with 1117 additions and 1117 deletions

View file

@ -42,14 +42,14 @@
/* C++ Game of Life implementation for any mode for which mode set
and draw pixel functions can be provided.
Tested with Borland C++ in the small model. */
#include &ltstdlib.h&gt
#include &ltstdio.h&gt
#include &ltiostream.h&gt
#include &ltconio.h&gt
#include &lttime.h&gt
#include &ltdos.h&gt
#include &ltbios.h&gt
#include &ltmem.h&gt
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
#include <time.h>
#include <dos.h>
#include <bios.h>
#include <mem.h>
#define ON_COLOR 15 // on-cell pixel color
#define OFF_COLOR 0 // off-cell pixel color
@ -68,11 +68,11 @@ private:
public:
cellmap(unsigned int h, unsigned int v);
~cellmap(void);
void copy_cells(cellmap &ampsourcemap);
void copy_cells(cellmap &sourcemap);
void set_cell(unsigned int x, unsigned int y);
void clear_cell(unsigned int x, unsigned int y);
int cell_state(int x, int y);
void next_generation(cellmap&amp dest_map);
void next_generation(cellmap& dest_map);
};
extern void enter_display_mode(void);
@ -86,7 +86,7 @@ extern void show_text(int x, int y, char *text);
display at right. */
unsigned int cellmap_width = 96;
unsigned int cellmap_height = 96;
/* Width &amp height in pixels of each cell as displayed on screen. */
/* Width & height in pixels of each cell as displayed on screen. */
unsigned int magnifier = 2;
void main()
@ -100,12 +100,12 @@ void main()
cellmap next_map(cellmap_height, cellmap_width);
// Get the seed; seed randomly if 0 entered
cout &lt&lt “Seed (0 for random seed): ”;
cin &gt&gt seed;
cout << “Seed (0 for random seed): ”;
cin >> seed;
if (seed == 0) seed = (unsigned) time(NULL);
// Randomly initialize the initial cell map
cout &lt&lt “Initializing...”;
cout << “Initializing...”;
srand(seed);
init_length = (cellmap_height * cellmap_width) / 2;
do {
@ -120,7 +120,7 @@ void main()
// Keep recalculating and redisplaying generations until a key
// is pressed
show_text(0, MSG_LINE, “Generation: ”);
start_bios_time = _bios_timeofday(_TIME_GETCLOCK, &ampbios_time);
start_bios_time = _bios_timeofday(_TIME_GETCLOCK, &bios_time);
do {
generation++;
sprintf(gen_text, “%10lu”, generation);
@ -132,15 +132,15 @@ void main()
#if LIMIT_18_HZ
// Limit to a maximum of 18.2 frames per second,for visibility
do {
_bios_timeofday(_TIME_GETCLOCK, &ampbios_time);
_bios_timeofday(_TIME_GETCLOCK, &bios_time);
} while (start_bios_time == bios_time);
start_bios_time = bios_time;
#endif
} while (!kbhit());
getch(); // clear keypress
exit_display_mode();
cout &lt&lt “Total generations: ” &lt&lt generation &lt&lt “\nSeed: ” &lt&lt
seed &lt&lt “\n”;
cout << “Total generations: ” << generation << “\nSeed: ” <<
seed << “\n”;
}
/* cellmap constructor. */
@ -162,7 +162,7 @@ cellmap::~cellmap(void)
/* Copies one cellmap’s cells to another cellmap. Both cellmaps are
assumed to be the same size. */
void cellmap::copy_cells(cellmap &ampsourcemap)
void cellmap::copy_cells(cellmap &sourcemap)
{
memcpy(cells, sourcemap.cells, length_in_bytes);
}
@ -173,7 +173,7 @@ void cellmap::set_cell(unsigned int x, unsigned int y)
unsigned char *cell_ptr =
cells + (y * width_in_bytes) + (x / 8);
*(cell_ptr) |= 0x80 &gt&gt (x &amp 0x07);
*(cell_ptr) |= 0x80 >> (x & 0x07);
}
/* Turns cell off. */
@ -182,7 +182,7 @@ void cellmap::clear_cell(unsigned int x, unsigned int y)
unsigned char *cell_ptr =
cells + (y * width_in_bytes) + (x / 8);
*(cell_ptr) &amp= ~(0x80 &gt&gt (x &amp 0x07));
*(cell_ptr) &= ~(0x80 >> (x & 0x07));
}
/* Returns cell state (1=on or 0=off), optionally wrapping at the
@ -192,26 +192,26 @@ int cellmap::cell_state(int x, int y)
unsigned char *cell_ptr;
#if WRAP_EDGES
while (x &lt 0) x += width; // wrap, if necessary
while (x &gt= width) x -= width;
while (y &lt 0) y += height;
while (y &gt= height) y -= height;
while (x < 0) x += width; // wrap, if necessary
while (x >= width) x -= width;
while (y < 0) y += height;
while (y >= height) y -= height;
#else
if ((x &lt 0) || (x &gt= width) || (y &lt 0) || (y &gt= height))
if ((x < 0) || (x >= width) || (y < 0) || (y >= height))
return 0; // return 0 for off edges if no wrapping
#endif
cell_ptr = cells + (y * width_in_bytes) + (x / 8);
return (*cell_ptr &amp (0x80 &gt&gt (x &amp 0x07))) ? 1 : 0;
return (*cell_ptr & (0x80 >> (x & 0x07))) ? 1 : 0;
}
/* Calculates the next generation of a cellmap and stores it in
next_map. */
void cellmap::next_generation(cellmap&amp next_map)
void cellmap::next_generation(cellmap& next_map)
{
unsigned int x, y, neighbor_count;
for (y=0; y&ltheight; y++) {
for (x=0; x&ltwidth; x++) {
for (y=0; y<height; y++) {
for (x=0; x<width; x++) {
// Figure out how many neighbors this cell has
neighbor_count = cell_state(x-1, y-1) + cell_state(x, y-1) +
cell_state(x+1, y-1) + cell_state(x-1, y) +
@ -219,7 +219,7 @@ void cellmap::next_generation(cellmap&amp next_map)
cell_state(x, y+1) + cell_state(x+1, y+1);
if (cell_state(x, y) == 1) {
// The cell is on; does it stay on?
if ((neighbor_count != 2) &amp&amp (neighbor_count != 3)) {
if ((neighbor_count != 2) && (neighbor_count != 3)) {
next_map.clear_cell(x, y); // turn it off
draw_pixel(x, y, OFF_COLOR);
}
@ -240,17 +240,17 @@ void cellmap::next_generation(cellmap&amp next_map)
<PRE>
/* VGA mode 13h functions for Game of Life.
Tested with Borland C++. */
#include &ltstdio.h&gt
#include &ltconio.h&gt
#include &ltdos.h&gt
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;dos.h&gt;
#define TEXT_X_OFFSET 27
#define SCREEN_WIDTH_IN_BYTES 320
/* Width &amp height in pixels of each cell. */
/* Width &amp; height in pixels of each cell. */
extern unsigned int magnifier;
/* Mode 13h draw pixel function. Pixels are of width &amp height
/* Mode 13h draw pixel function. Pixels are of width &amp; height
specified by magnifier. */
void draw_pixel(unsigned int x, unsigned int y, unsigned int color)
{
@ -261,8 +261,8 @@ void draw_pixel(unsigned int x, unsigned int y, unsigned int color)
FP_SEG(screen_ptr) = SCREEN_SEGMENT;
FP_OFF(screen_ptr) =
y * magnifier * SCREEN_WIDTH_IN_BYTES + x * magnifier;
for (i=0; i&ltmagnifier; i++) {
for (j=0; j&ltmagnifier; j++) {
for (i=0; i&lt;magnifier; i++) {
for (j=0; j&lt;magnifier; j++) {
*(screen_ptr+j) = color;
}
screen_ptr += SCREEN_WIDTH_IN_BYTES;
@ -275,7 +275,7 @@ void enter_display_mode()
union REGS regset;
regset.x.ax = 0x0013;
int86(0x10, &ampregset, &ampregset);
int86(0x10, &amp;regset, &amp;regset);
}
/* Text mode mode-set function. */
@ -284,7 +284,7 @@ void exit_display_mode()
union REGS regset;
regset.x.ax = 0x0003;
int86(0x10, &ampregset, &ampregset);
int86(0x10, &amp;regset, &amp;regset);
}
/* Text display function. Offsets text to non-graphics area of