Sha256: b2ab1adb5c71f7ec81a41100fdcaae1c88e68d363d38af469f56161e16cf8771

Contents?: true

Size: 1 KB

Versions: 10

Compression:

Stored size: 1 KB

Contents

Enter Two Numbers is a room.

Numerically entering is an action applying to one number. Understand "[number]" as numerically entering.

The first number is a number that varies.

After numerically entering for the first time:
	now the first number is the number understood.

After numerically entering for the second time:
	let A be the first number;
	let B be the number understood;
	say "[A] + [B] = [A + B]."; [operator syntax]
	say "[A] - [B] = [A minus B]."; [English syntax]
	let P be given by P = A * B where P is a number; [inline equation]
	say "[A] * [B] = [P].";
	let Q be given by the Division Formula; [named equation]
	say "[A] / [B] = [Q].";
	say "[A] mod [B] = [remainder after dividing A by B].";
	end the story.

Equation - Division Formula
	Q = A / B
where Q is a number, A is a number, and B is a number.

This solution shows four syntaxes: mathematical operators, English operators, inline equations, and named equations. Division rounds toward zero, and the remainder has the same sign as the quotient.

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/inform_7.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/inform_7.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/inform_7.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/inform_7.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/inform_7.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/inform_7.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/inform_7.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/inform_7.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/inform_7.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/inform_7.txt