WeiWeiXinNet/Games/game8/js/rpncalc.js
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*jslint -W033, -W061, browser:true, devel:true, white:true, vars:true, eqeq:true */
/*global $:false, intel:false, xpnt:false*/
/*
* Copyright (c) 2012, Intel Corporation. All rights reserved.
* File revision: 04 October 2012
* Please see http://software.intel.com/html5/license/samples
* and the included README.md file for license terms and conditions.
*/
var calc;
var CLEAR = "0.00";
var ZERODOT = "0.";
var STACKSIZE = 3;
// Button Strings - for clarity, some functions are
// associated with const global vars
// y is top of stack, x is currently displayed number
var FN = "Fn"; // Fn button
var ROLLUP = "R↑" // Roll through stack up
var ROLLDN = "R↓" // Roll through stack down
function NumButton(n) {
this.text = "<span class='btnNumText btnFont'>" + n + "</span>"
this.fcn = function() {
calc.display.num(n)
}
}
//Optional second arg, in case you want to format op,
//i.e. &ndash in place of '-'
function BinopButton(o, plain) {
this.text = "<span class='btnMathText btnFont'>" + o + "</span>"
if (plain) {
o = plain
}
this.fcn = function() {
calc.keypad.binaryOp(o)
}
}
function make_layouts(pad, display, stack) {
//Button Layouts
// Chrome (webkit) doesn't support mathml
// [ {text:"<math><msqrt><mi>x</mi></msqrt></math>", fcn: function () { pad.unaryOp(Math.sqrt)}},
// [ {text:"sqrt", fcn: function () { pad.unaryOp(Math.sqrt)}},
// [ {text:"√<span style='text-decoration:overline;'>x</span>", fcn: function () { pad.unaryOp(Math.sqrt)}},
// [ {text:"√<span style='margin-left:-0.08em; font-size:80%; border-top:0.25ex solid;'>x</span>", fcn: function () { pad.unaryOp(Math.sqrt)}},
var oneLayout = [
[{
text: "<span class='btnThemeText btnFont'>theme</span>",
fcn: pad.toggleTheme
}, {
text: "<span class='btnFnText btnFont'>R↑</span>",
fcn: function() {
stack.rollup(display)
}
}, {
text: "<span class='btnFnText btnFont'>R↓</span>",
fcn: function() {
stack.rolldown(display)
}
}, {
后面还有 357 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。