Skip to content

Commit

Permalink
No need to test rand Char.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunoru committed Aug 5, 2021
1 parent b79d7c6 commit 20992ca
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ using Test
@test randperm(r, 10) == [2, 10, 1, 6, 4, 3, 7, 8, 9, 5]
@test randcycle(r, 10) == [8, 4, 5, 1, 10, 2, 3, 9, 7, 6]
@test rand(r, ComplexF64) == 0.9500729643158807 + 0.9280185794620359im
@test rand(r, Char) == '\Ufe68e'
end

3 comments on commit 20992ca

@sunoru
Copy link
Member Author

@sunoru sunoru commented on 20992ca Aug 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/42202

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.5.3 -m "<description of version>" 20992caa581473dc805f9236760c35d96fbc4f29
git push origin v1.5.3

@kharevit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function arrayRemove(a, b) {
return a.filter(function(a) {
return a !== b
})
}
function shuffleArray(a, b, c) {
if (void 0 === c || c > a.length)
c = a.length - 1;
if (void 0 === b || 0 > b)
b = 0;
for (var d = c; d >= b; d--) {
var e = randomInt(b, c)
, f = [a[e], a[d]];
a[d] = f[0];
a[e] = f[1]
}
}
unction randomInt(a, b) {
return Math.floor(Math.random() * (b - a + 1)) + a
}
function fallbackCopyTextToClipboard(a) {
var b = document.createElement("textarea");
b.value = a;
document.body.appendChild(b);
b.focus();
b.select();
try {
var c = document.execCommand("copy") ? "successful" : "unsuccessful";
console.log("Fallback: Copying text command was " + c)
} catch (d) {
console.error("Fallback: Oops, unable to copy", d)
}
document.body.removeChild(b)
}
function copyTextToClipboard(a) {
navigator.clipboard ? navigator.clipboard.writeText(a).then(function() {
cs.toast.showMessage("\u0110\u00e3 copy!");
console.log("Async: Copying to clipboard was successful!")
}, function(a) {
console.error("Async: Could not copy text: ", a)
}) : fallbackCopyTextToClipboard(a)
}
function angleBetween2Points(a, b) {
var c = cc.pDistance(a, b)
, c = Math.acos((a.x - b.x) / c);
return b.y < a.y ? cc.radiansToDegrees(-c) : cc.radiansToDegrees(c)
}
var getRandomNumber = function(a, b) {
return Math.floor(Math.random() * (b - a + 1)) + a
};
function loadImage(a) {
return new Promise(function(b, c) {
var d = cc.textureCache.getTextureForKey(a);
d ? b(d) : cc.loader.loadImg(a, function(d, f) {
if (null === d) {
var g = cc.textureCache.handleLoadedTexture(a, f);
cc.textureCache.cacheImage(a, g);
b(g)
} else
c(d)
})
}
)
}
function fetchAvatar(a) {
return new Promise(function(b, c) {
var d = a.substr(a.length - 13)
, e = cc.spriteFrameCache.getSpriteFrame(d);
cc.spriteFrameCache.getSpriteFrame(d) ? b(e) : (d = cc.textureCache.getTextureForKey(a)) ? b(d) : cc.loader.loadImg(a, function(d, e) {
if (null === d) {
var h = cc.textureCache.handleLoadedTexture(a, e);
cc.textureCache.cacheImage(a, h);
b(h)
} else
c(d)
})
}
)
}
function openUrl(a) {
cc.sys.isMobile ? window.location = a : window.open(a, "_blank")
}
function getGPUInfo() {
var a, b;
a = gl.getExtension("WEBGL_debug_renderer_info");
b = gl.getParameter(a.UNMASKED_VENDOR_WEBGL);
a = gl.getParameter(a.UNMASKED_RENDERER_WEBGL);
return {
vendor: b,
renderer: a
}
}
function loadResources(a, b) {
var c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : ""
, d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : !0
, e = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : 0
, f = !0;
cc.loader.load(a, function(a, b, c) {
null === a && (f = !1)
}
.bind(this), function() {
!f && 5 > e ? loadResources(a, b, c, e + 1) : (f || d && cs.toast.showMessage("Download " + c + " th\u1ea5t b\u1ea1i! Vui l\u00f2ng th\u1eed l\u1ea1i sau!"),
b(f))
})
}
function getDesktopScale() {
return cc.sys.isMobile ? 1 : 1080 === cc.view.getDesignResolutionSize().height ? 1 : 0.7
}
var timerId;
function throttleFunction(a, b) {
for (var c = arguments.length, d = Array(2 < c ? c - 2 : 0), e = 2; e < c; e++)
d[e - 2] = arguments[e];
timerId || (timerId = setTimeout(function() {
a(d);
timerId = void 0
}, 1E3 * b))
}
;function uuid() {
var a = Date.now();
window.performance && "function" === typeof window.performance.now && (a += performance.now());
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(b) {
var c = (a + 16 * Math.random()) % 16 | 0;
a = Math.floor(a / 16);
return ("x" === b ? c : c & 11).toString(16)
})
}
cs.uuid = uuid;
var AudioEngine = cc.Class.extend({
_className: "AudioEngine",
isMuteMusic: !1,
isMuteEffect: !1,
effectAudio: {},
currentMusicUrl: null,
ctor: function() {
var a = localStorage.getItem("muteMusic");
"boolean" == typeof a && (this.isMuteMusic = a);
a = localStorage.getItem("muteEffect");
"boolean" == typeof a && (this.isMuteEffect = a);
this.isPlayingInGame = this.isPlayingLobby = !1;
return !0
},
isPlaying: function() {
return cc.audioEngine.isMusicPlaying()
},
playMusic: function(a) {
var b = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : !1
, c = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !1
, d = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : !1;
this.currentMusicUrl === a && cc.audioEngine.isMusicPlaying() || (this.currentMusicUrl = a,
!0 !== this.isMuteMusic && (this.isPlayingLobby = c,
this.isPlayingInGame = d,
cc.audioEngine.playMusic(a, b)))
},
playEffect: function(a) {
var b = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : !1;
!0 !== this.isMuteEffect && (this.effectAudio[a] = cc.audioEngine.playEffect(a, b))
},
stopEffect: function(a) {
cc.audioEngine.stopEffect(this.effectAudio[a])
},
playLobbyMusic: function() {
var a = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : !0;
null !== a && "boolean" === typeof a && !0 === a ? this._playLobbyMusic() : !0 !== this.isPlayingLobby && this._playLobbyMusic()
},
playInGameMusic: function(a) {
null !== a && "boolean" === typeof a ? !0 === a && this._playInGameMusic() : !0 !== this.isPlayingInGame && this._playInGameMusic()
},
_playLobbyMusic: function() {
this.playMusic(sound_res.lb_music, !0, !0, !1)
},
_playInGameMusic: function() {
this.playMusic(sound_res.ig_music, !0, !1, !0)
},
stopMusic: function() {
this.isPlayingInGame = this.isPlayingLobby = !1;
cc.audioEngine.stopMusic(!0)
},
stopLobbyMusic: function() {
this.stopMusic()
},
setMuteMusic: function(a) {
(this.isMuteMusic = a) ? this.stopMusic() : this.currentMusicUrl && this.playMusic(this.currentMusicUrl, !0);
cc.eventManager.dispatchCustomEvent("changeMuteMusic", null)
},
setMuteEffect: function(a) {
(this.isMuteEffect = a) && this.stopAllEffects();
cc.eventManager.dispatchCustomEvent("changeMuteEffect", null)
},
stopAllEffects: function() {
cc.audioEngine.stopAllEffects()
},
stopAll: function() {
this.stopAllEffects();
this.stopMusic()
}
});
cs.audioEngine = new AudioEngine;
function _toConsumableArray(a) {
return _arrayWithoutHoles(a) || _iterableToArray(a) || _unsupportedIterableToArray(a) || _nonIterableSpread()
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a Symbol.iterator method.");
}
function _unsupportedIterableToArray(a, b) {
if (a) {
if ("string" === typeof a)
return _arrayLikeToArray(a, b);
var c = Object.prototype.toString.call(a).slice(8, -1);
"Object" === c && a.constructor && (c = a.constructor.name);
if ("Map" === c || "Set" === c)
return Array.from(a);
if ("Arguments" === c || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))
return _arrayLikeToArray(a, b)
}
}
function _iterableToArray(a) {
if ("undefined" !== typeof Symbol && Symbol.iterator in Object(a))
return Array.from(a)
}
function _arrayWithoutHoles(a) {
if (Array.isArray(a))
return _arrayLikeToArray(a)
}
function _arrayLikeToArray(a, b) {
if (null == b || b > a.length)
b = a.length;
for (var c = 0, d = Array(b); c < b; c++)
d[c] = a[c];
return d
}
cs.Card = {};
cs.Card.getCombination = function(a, b, c, d) {
for (var e = [], f = 0; f < c; f++) {
var g = new cs.GameCard(cs.GameCardType.BIG);
g.setTextureWithCode(1);
e.push(g)
}
this.combination(a, b, c, 0, e, 0, d)
}
;
cs.Card.combination = function(a, b, c, d, e, f, g) {
d === c ? (a = _toConsumableArray(e),
g.push(a)) : f >= b || (e[d] = a[f],
this.combination(a, b, c, d + 1, e, f + 1, g),
this.combination(a, b, c, d, e, f + 1, g))
}
;
cs.Card.Lieng = {};
cs.Card.Lieng.checkOnlyHaveJQK = function(a) {
for (var b = 0; b < a.length; b++)
if (11 > a[b].N || 13 < a[b].N)
return !1;
return !0
}
;
cs.Card.Lieng.checkStraight = function(a) {
var b = !1;
if (3 !== a.len)
return !1;
this.sortVector(a);
var c = a[0].N
, d = a[1].N;
a = a[2].N;
if (c + 1 === d && d + 1 === a || 3 === c && 14 === d && 15 === a || 3 === c && 4 === d && 15 === a)
b = !0;
13 === c && 14 === d && 15 === a && (b = !1);
return b
}
;
cs.Card.Lieng.sortVector = function(a) {
for (var b = 0; b < a.length - 1; ) {
for (var c = a[b], d = c.N, e = void 0, e = b + 1; e < a.length; e++) {
var f = a[e];
if (d > f.N) {
a[b] = f;
a[e] = c;
b = 0;
break
}
}
0 === b && e !== a.length || b++
}
}
;
cs.Card.Lieng.checkSameValue = function(a) {
return 3 !== a.length ? !1 : a[0].N === a[1].N && a[1].N === a[2].N
}
;
cs.Card.Lieng.getMark = function(a) {
for (var b = 0, c = 0; c < a.length; c++) {
var d = a[c].N;
13 < d && (d -= 13);
9 < d && (d = 0);
b += d
}
return b % 10
}
;
function _typeof(a) {
"@babel/helpers - typeof";
_typeof = "function" === typeof Symbol && "symbol" === typeof Symbol.iterator ? function(a) {
return typeof a
}
: function(a) {
return a && "function" === typeof Symbol && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a
}
;
return _typeof(a)
}
function _toConsumableArray(a) {
return _arrayWithoutHoles(a) || _iterableToArray(a) || _unsupportedIterableToArray(a) || _nonIterableSpread()
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a Symbol.iterator method.");
}
function _unsupportedIterableToArray(a, b) {
if (a) {
if ("string" === typeof a)
return _arrayLikeToArray(a, b);
var c = Object.prototype.toString.call(a).slice(8, -1);
"Object" === c && a.constructor && (c = a.constructor.name);
if ("Map" === c || "Set" === c)
return Array.from(a);
if ("Arguments" === c || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))
return _arrayLikeToArray(a, b)
}
}
function _iterableToArray(a) {
if ("undefined" !== typeof Symbol && Symbol.iterator in Object(a))
return Array.from(a)
}
function _arrayWithoutHoles(a) {
if (Array.isArray(a))
return _arrayLikeToArray(a)
}
function _arrayLikeToArray(a, b) {
if (null == b || b > a.length)
b = a.length;
for (var c = 0, d = Array(b); c < b; c++)
d[c] = a[c];
return d
}

Please sign in to comment.