System Puzzles
These puzzles may be used to perform various system functions such as printing to console, measuring performance, getting/setting rendered pixel ratio and retrieving the GPU information.

"print to console"
Prints data of any type to the browser console. The latter can usually be opened with the F12 key (Chrome, Firefox on Windows, Linux). On Mac use the View > Developer > JavaScript Console menu (Option-Cmd-J) in Chrome, or the Develop > Show Error Console menu (Option-Cmd-C) in Safari.

"print performance info"
Records a performance profile during 1 second and prints it to the browser console. The latter can usually be opened with the F12 key (Chrome, Firefox on Windows, Linux). On Mac use the View > Developer > JavaScript Console menu (Option-Cmd-J) in Chrome, or the Develop > Show Error Console menu (Option-Cmd-C) in Safari.

"feature available"
Check if a feature selected from the drop-down is available in the user's browser.

"get GPU"
Outputs the user's GPU info - vendor, for example: NVIDIA Corporation, Apple Inc., Qualcomm, and GPU model, for example: GeForce GTX 1060 3GB/PCIe/SSE2, Apple A9 GPU, Adreno (TM) 330.

"set screen scale"
Set screen resolution factor for the rendered canvas. Set this value higher than 1 to improve quality, 1 - default screen scale on non-retina displays.

"native screen scale"
Native canvas resolution factor. Equal to 1 for non-retina displays.

"detect gamepad device"
Detect gamepad devices connected to or disconnected from your system. When a new gamepad device found, the puzzles specified in the "once connected do" slot are triggered. When the device disconnected, the puzzles specified in the "once disconnected do" slot are triggered. In any case the value "gamepad index" is set and returns the device index.
"gamepad index"
Returns connected/disconnected gamepad device index.
"get gamepad property"
Returns a gamepad property for the device with the given index:
- *connection status* — whether the device is connected (returns true) or disconnected (returns false).
- *axis* — device axis position in the range -1.0–1.0. For example, an analog thumb stick found on all recent gamepads is represented by two axes: left–right and up–down.
- *button* — device button state. Returns true when the button is pressed and false otherwise.
- *analog button* — analog button state. Similar to button but can detect the amount which the button has been pressed. Returns value in the range 0–1.
- *id* — device ID string. Identifies the brand and model of the connected device.
- *timestamp* — last time the axes/buttons for the gamepad were updated. You can store this value in a variable and compare with the current timestamp each frame to detect that some axis/angle was changed.
To assign axes buttons in your application use the Gamepad Diagnostics tool or follow the Standard Gamepad layout (does not work properly for all kinds of devices):