Split long lines in a comment in {Java, JavaScript, C++, Python, Rust} language versions, without changing wording.

pull/16/head
Project Nayuki 7 years ago
parent 2fd05cc7ef
commit 1d5ceab068

@ -141,8 +141,9 @@ class QrCode final {
/* /*
* Returns the color of the module (pixel) at the given coordinates, which is either 0 for white or 1 for black. The top * Returns the color of the module (pixel) at the given coordinates, which is either
* left corner has the coordinates (x=0, y=0). If the given coordinates are out of bounds, then 0 (white) is returned. * 0 for white or 1 for black. The top left corner has the coordinates (x=0, y=0).
* If the given coordinates are out of bounds, then 0 (white) is returned.
*/ */
public: int getModule(int x, int y) const; public: int getModule(int x, int y) const;

@ -258,8 +258,9 @@ public final class QrCode {
/*---- Public instance methods ----*/ /*---- Public instance methods ----*/
/** /**
* Returns the color of the module (pixel) at the specified coordinates, which is either 0 for white or 1 for black. The top * Returns the color of the module (pixel) at the specified coordinates, which is either
* left corner has the coordinates (x=0, y=0). If the specified coordinates are out of bounds, then 0 (white) is returned. * 0 for white or 1 for black. The top left corner has the coordinates (x=0, y=0).
* If the specified coordinates are out of bounds, then 0 (white) is returned.
* @param x the x coordinate, where 0 is the left edge and size−1 is the right edge * @param x the x coordinate, where 0 is the left edge and size−1 is the right edge
* @param y the y coordinate, where 0 is the top edge and size−1 is the bottom edge * @param y the y coordinate, where 0 is the top edge and size−1 is the bottom edge
* @return the module's color, which is either 0 (white) or 1 (black) * @return the module's color, which is either 0 (white) or 1 (black)

@ -163,8 +163,9 @@ var qrcodegen = new function() {
/*---- Accessor methods ----*/ /*---- Accessor methods ----*/
// (Public) Returns the color of the module (pixel) at the given coordinates, which is either 0 for white or 1 for black. The top // (Public) Returns the color of the module (pixel) at the given coordinates, which is either
// left corner has the coordinates (x=0, y=0). If the given coordinates are out of bounds, then 0 (white) is returned. // 0 for white or 1 for black. The top left corner has the coordinates (x=0, y=0).
// If the given coordinates are out of bounds, then 0 (white) is returned.
this.getModule = function(x, y) { this.getModule = function(x, y) {
if (0 <= x && x < size && 0 <= y && y < size) if (0 <= x && x < size && 0 <= y && y < size)
return modules[y][x] ? 1 : 0; return modules[y][x] ? 1 : 0;

@ -225,8 +225,9 @@ class QrCode(object):
return self._mask return self._mask
def get_module(self, x, y): def get_module(self, x, y):
"""Returns the color of the module (pixel) at the given coordinates, which is either 0 for white or 1 for black. The top """Returns the color of the module (pixel) at the given coordinates, which is either
left corner has the coordinates (x=0, y=0). If the given coordinates are out of bounds, then 0 (white) is returned.""" 0 for white or 1 for black. The top left corner has the coordinates (x=0, y=0).
If the given coordinates are out of bounds, then 0 (white) is returned."""
return 1 if ((0 <= x < self._size) and (0 <= y < self._size) and self._modules[y][x]) else 0 return 1 if ((0 <= x < self._size) and (0 <= y < self._size) and self._modules[y][x]) else 0

@ -200,8 +200,9 @@ impl QrCode {
} }
// Returns the color of the module (pixel) at the given coordinates, which is either false for white or true for black. The top // Returns the color of the module (pixel) at the given coordinates, which is either
// left corner has the coordinates (x=0, y=0). If the given coordinates are out of bounds, then 0 (white) is returned. // false for white or true for black. The top left corner has the coordinates (x=0, y=0).
// If the given coordinates are out of bounds, then 0 (white) is returned.
pub fn get_module(&self, x: i32, y: i32) -> bool { pub fn get_module(&self, x: i32, y: i32) -> bool {
0 <= x && x < self.size && 0 <= y && y < self.size && self.module(x, y) 0 <= x && x < self.size && 0 <= y && y < self.size && self.module(x, y)
} }

Loading…
Cancel
Save