From e9ec1599e274d0748992705be988e4966910aea4 Mon Sep 17 00:00:00 2001 From: chrisbradleyjones Date: Wed, 17 Jul 2024 17:51:47 +0530 Subject: [PATCH] new lesson, did i mess up anything? --- README.md | 8 +- code/highlight.min.js | 788 +++++++++++------------ code/run_prettify.js | 64 -- code/vs2015.css | 198 +++--- courses/advanced/change-splash.html | 101 +++ courses/advanced/compile-upbge.html | 8 +- courses/advanced/intro.html | 10 +- courses/tutorials/character-physics.html | 356 +++++----- courses/tutorials/py-ingame-cheats.html | 590 ++++++++--------- courses/tutorials/py-toggle-buttons.html | 288 ++++----- courses/tutorials/set-resolution.html | 282 ++++---- img/bgeninja.svg | 44 +- img/bgeninja2.svg | 12 +- img/range.svg | 100 +-- img/upbge.svg | 218 +++---- index.html | 2 +- style3.css | 18 +- vs2015.css | 198 +++--- 18 files changed, 1668 insertions(+), 1617 deletions(-) delete mode 100644 code/run_prettify.js create mode 100644 courses/advanced/change-splash.html diff --git a/README.md b/README.md index 1398e63..51ec816 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# BGENinja -Hi, this is a tutorial for the game engine [UPBGE](https://upbge.org/) and [Range Engine](https://rangeengine.tech/). -Project files are available in this site too. -Making changes as fast as possible. +# BGENinja +Hi, this is a tutorial for the game engine [UPBGE](https://upbge.org/) and [Range Engine](https://rangeengine.tech/). +Project files are available in this site too. +Making changes as fast as possible. diff --git a/code/highlight.min.js b/code/highlight.min.js index c27fc8c..63dd904 100644 --- a/code/highlight.min.js +++ b/code/highlight.min.js @@ -1,395 +1,395 @@ -/*! - Highlight.js v11.9.0 (git: b7ec4bfafc) - (c) 2006-2024 undefined and other contributors - License: BSD-3-Clause - */ -var hljs=function(){"use strict";function e(t){ -return t instanceof Map?t.clear=t.delete=t.set=()=>{ -throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ -throw Error("set is read-only") -}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{ -const i=t[n],s=typeof i;"object"!==s&&"function"!==s||Object.isFrozen(i)||e(i) -})),t}class t{constructor(e){ -void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} -ignoreMatch(){this.isMatchIgnored=!0}}function n(e){ -return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") -}function i(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] -;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const s=e=>!!e.scope -;class o{constructor(e,t){ -this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ -this.buffer+=n(e)}openNode(e){if(!s(e))return;const t=((e,{prefix:t})=>{ -if(e.startsWith("language:"))return e.replace("language:","language-") -;if(e.includes(".")){const n=e.split(".") -;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") -}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)} -closeNode(e){s(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ -this.buffer+=``}}const r=(e={})=>{const t={children:[]} -;return Object.assign(t,e),t};class a{constructor(){ -this.rootNode=r(),this.stack=[this.rootNode]}get top(){ -return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ -this.top.children.push(e)}openNode(e){const t=r({scope:e}) -;this.add(t),this.stack.push(t)}closeNode(){ -if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ -for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} -walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ -return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), -t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ -"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ -a._collapse(e)})))}}class c extends a{constructor(e){super(),this.options=e} -addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ -this.closeNode()}__addSublanguage(e,t){const n=e.root -;t&&(n.scope="language:"+t),this.add(n)}toHTML(){ -return new o(this,this.options).value()}finalize(){ -return this.closeAllNodes(),!0}}function l(e){ -return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")} -function u(e){return h("(?:",e,")*")}function d(e){return h("(?:",e,")?")} -function h(...e){return e.map((e=>l(e))).join("")}function f(...e){const t=(e=>{ -const t=e[e.length-1] -;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} -})(e);return"("+(t.capture?"":"?:")+e.map((e=>l(e))).join("|")+")"} -function p(e){return RegExp(e.toString()+"|").exec("").length-1} -const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ -;function m(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n -;let i=l(e),s="";for(;i.length>0;){const e=b.exec(i);if(!e){s+=i;break} -s+=i.substring(0,e.index), -i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0], -"("===e[0]&&n++)}return s})).map((e=>`(${e})`)).join(t)} -const E="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",O={ -begin:"\\\\[\\s\\S]",relevance:0},v={scope:"string",begin:"'",end:"'", -illegal:"\\n",contains:[O]},k={scope:"string",begin:'"',end:'"',illegal:"\\n", -contains:[O]},N=(e,t,n={})=>{const s=i({scope:"comment",begin:e,end:t, -contains:[]},n);s.contains.push({scope:"doctag", -begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", -end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) -;const o=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) -;return s.contains.push({begin:h(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s -},S=N("//","$"),M=N("/\\*","\\*/"),R=N("#","$");var j=Object.freeze({ -__proto__:null,APOS_STRING_MODE:v,BACKSLASH_ESCAPE:O,BINARY_NUMBER_MODE:{ -scope:"number",begin:_,relevance:0},BINARY_NUMBER_RE:_,COMMENT:N, -C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:S,C_NUMBER_MODE:{scope:"number", -begin:y,relevance:0},C_NUMBER_RE:y,END_SAME_AS_BEGIN:e=>Object.assign(e,{ -"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ -t.data._beginMatch!==e[1]&&t.ignoreMatch()}}),HASH_COMMENT_MODE:R,IDENT_RE:E, -MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+x,relevance:0}, -NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w, -PHRASAL_WORDS_MODE:{ -begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ -},QUOTE_STRING_MODE:k,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/, -end:/\/[gimuy]*/,contains:[O,{begin:/\[/,end:/\]/,relevance:0,contains:[O]}]}, -RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", -SHEBANG:(e={})=>{const t=/^#![ ]*\// -;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),i({scope:"meta",begin:t, -end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, -TITLE_MODE:{scope:"title",begin:E,relevance:0},UNDERSCORE_IDENT_RE:x, -UNDERSCORE_TITLE_MODE:{scope:"title",begin:x,relevance:0}});function A(e,t){ -"."===e.input[e.index-1]&&t.ignoreMatch()}function I(e,t){ -void 0!==e.className&&(e.scope=e.className,delete e.className)}function T(e,t){ -t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", -e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, -void 0===e.relevance&&(e.relevance=0))}function L(e,t){ -Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function B(e,t){ -if(e.match){ -if(e.begin||e.end)throw Error("begin & end are not supported with match") -;e.begin=e.match,delete e.match}}function P(e,t){ -void 0===e.relevance&&(e.relevance=1)}const D=(e,t)=>{if(!e.beforeMatch)return -;if(e.starts)throw Error("beforeMatch cannot be used with starts") -;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] -})),e.keywords=n.keywords,e.begin=h(n.beforeMatch,g(n.begin)),e.starts={ -relevance:0,contains:[Object.assign(n,{endsParent:!0})] -},e.relevance=0,delete n.beforeMatch -},H=["of","and","for","in","not","or","if","then","parent","list","value"],C="keyword" -;function $(e,t,n=C){const i=Object.create(null) -;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ -Object.assign(i,$(e[n],t,n))})),i;function s(e,n){ -t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") -;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ -return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}const z={},W=e=>{ -console.error(e)},X=(e,...t)=>{console.log("WARN: "+e,...t)},G=(e,t)=>{ -z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) -},K=Error();function F(e,t,{key:n}){let i=0;const s=e[n],o={},r={} -;for(let e=1;e<=t.length;e++)r[e+i]=s[e],o[e+i]=!0,i+=p(t[e-1]) -;e[n]=r,e[n]._emit=o,e[n]._multi=!0}function Z(e){(e=>{ -e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, -delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ -_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope -}),(e=>{if(Array.isArray(e.begin)){ -if(e.skip||e.excludeBegin||e.returnBegin)throw W("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), -K -;if("object"!=typeof e.beginScope||null===e.beginScope)throw W("beginScope must be object"), -K;F(e,e.begin,{key:"beginScope"}),e.begin=m(e.begin,{joinWith:""})}})(e),(e=>{ -if(Array.isArray(e.end)){ -if(e.skip||e.excludeEnd||e.returnEnd)throw W("skip, excludeEnd, returnEnd not compatible with endScope: {}"), -K -;if("object"!=typeof e.endScope||null===e.endScope)throw W("endScope must be object"), -K;F(e,e.end,{key:"endScope"}),e.end=m(e.end,{joinWith:""})}})(e)}function V(e){ -function t(t,n){ -return RegExp(l(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) -}class n{constructor(){ -this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} -addRule(e,t){ -t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), -this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) -;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(m(e,{joinWith:"|" -}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex -;const t=this.matcherRe.exec(e);if(!t)return null -;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] -;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ -this.rules=[],this.multiRegexes=[], -this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ -if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n -;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), -t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ -return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ -this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ -const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex -;let n=t.exec(e) -;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ -const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} -return n&&(this.regexIndex+=n.position+1, -this.regexIndex===this.count&&this.considerAll()),n}} -if(e.compilerExtensions||(e.compilerExtensions=[]), -e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") -;return e.classNameAliases=i(e.classNameAliases||{}),function n(o,r){const a=o -;if(o.isCompiled)return a -;[I,B,Z,D].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))), -o.__beforeBegin=null,[T,L,P].forEach((e=>e(o,r))),o.isCompiled=!0;let c=null -;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords), -c=o.keywords.$pattern, -delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=$(o.keywords,e.case_insensitive)), -a.keywordPatternRe=t(c,!0), -r&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/), -o.end&&(a.endRe=t(a.end)), -a.terminatorEnd=l(a.end)||"",o.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)), -o.illegal&&(a.illegalRe=t(o.illegal)), -o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>i(e,{ -variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?i(e,{ -starts:e.starts?i(e.starts):null -}):Object.isFrozen(e)?i(e):e))("self"===e?o:e)))),o.contains.forEach((e=>{n(e,a) -})),o.starts&&n(o.starts,r),a.matcher=(e=>{const t=new s -;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" -}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" -}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ -return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ -constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} -const Y=n,Q=i,ee=Symbol("nomatch"),te=n=>{ -const i=Object.create(null),s=Object.create(null),o=[];let r=!0 -;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ -disableAutodetect:!0,name:"Plain text",contains:[]};let p={ -ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, -languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", -cssSelector:"pre code",languages:null,__emitter:c};function b(e){ -return p.noHighlightRe.test(e)}function m(e,t,n){let i="",s="" -;"object"==typeof t?(i=e, -n=t.ignoreIllegals,s=t.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."), -G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), -s=e,i=t),void 0===n&&(n=!0);const o={code:i,language:s};N("before:highlight",o) -;const r=o.result?o.result:E(o.language,o.code,n) -;return r.code=o.code,N("after:highlight",r),r}function E(e,n,s,o){ -const c=Object.create(null);function l(){if(!N.keywords)return void M.addText(R) -;let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(R),n="" -;for(;t;){n+=R.substring(e,t.index) -;const s=_.case_insensitive?t[0].toLowerCase():t[0],o=(i=s,N.keywords[i]);if(o){ -const[e,i]=o -;if(M.addText(n),n="",c[s]=(c[s]||0)+1,c[s]<=7&&(j+=i),e.startsWith("_"))n+=t[0];else{ -const n=_.classNameAliases[e]||e;u(t[0],n)}}else n+=t[0] -;e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(R)}var i -;n+=R.substring(e),M.addText(n)}function g(){null!=N.subLanguage?(()=>{ -if(""===R)return;let e=null;if("string"==typeof N.subLanguage){ -if(!i[N.subLanguage])return void M.addText(R) -;e=E(N.subLanguage,R,!0,S[N.subLanguage]),S[N.subLanguage]=e._top -}else e=x(R,N.subLanguage.length?N.subLanguage:null) -;N.relevance>0&&(j+=e.relevance),M.__addSublanguage(e._emitter,e.language) -})():l(),R=""}function u(e,t){ -""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function d(e,t){let n=1 -;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue} -const i=_.classNameAliases[e[n]]||e[n],s=t[n];i?u(s,i):(R=s,l(),R=""),n++}} -function h(e,t){ -return e.scope&&"string"==typeof e.scope&&M.openNode(_.classNameAliases[e.scope]||e.scope), -e.beginScope&&(e.beginScope._wrap?(u(R,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), -R=""):e.beginScope._multi&&(d(e.beginScope,t),R="")),N=Object.create(e,{parent:{ -value:N}}),N}function f(e,n,i){let s=((e,t)=>{const n=e&&e.exec(t) -;return n&&0===n.index})(e.endRe,i);if(s){if(e["on:end"]){const i=new t(e) -;e["on:end"](n,i),i.isMatchIgnored&&(s=!1)}if(s){ -for(;e.endsParent&&e.parent;)e=e.parent;return e}} -if(e.endsWithParent)return f(e.parent,n,i)}function b(e){ -return 0===N.matcher.regexIndex?(R+=e[0],1):(T=!0,0)}function m(e){ -const t=e[0],i=n.substring(e.index),s=f(N,e,i);if(!s)return ee;const o=N -;N.endScope&&N.endScope._wrap?(g(), -u(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(g(), -d(N.endScope,e)):o.skip?R+=t:(o.returnEnd||o.excludeEnd||(R+=t), -g(),o.excludeEnd&&(R=t));do{ -N.scope&&M.closeNode(),N.skip||N.subLanguage||(j+=N.relevance),N=N.parent -}while(N!==s.parent);return s.starts&&h(s.starts,e),o.returnEnd?0:t.length} -let w={};function y(i,o){const a=o&&o[0];if(R+=i,null==a)return g(),0 -;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){ -if(R+=n.slice(o.index,o.index+1),!r){const t=Error(`0 width match regex (${e})`) -;throw t.languageName=e,t.badRule=w.rule,t}return 1} -if(w=o,"begin"===o.type)return(e=>{ -const n=e[0],i=e.rule,s=new t(i),o=[i.__beforeBegin,i["on:begin"]] -;for(const t of o)if(t&&(t(e,s),s.isMatchIgnored))return b(n) -;return i.skip?R+=n:(i.excludeBegin&&(R+=n), -g(),i.returnBegin||i.excludeBegin||(R=n)),h(i,e),i.returnBegin?0:n.length})(o) -;if("illegal"===o.type&&!s){ -const e=Error('Illegal lexeme "'+a+'" for mode "'+(N.scope||"")+'"') -;throw e.mode=N,e}if("end"===o.type){const e=m(o);if(e!==ee)return e} -if("illegal"===o.type&&""===a)return 1 -;if(I>1e5&&I>3*o.index)throw Error("potential infinite loop, way more iterations than matches") -;return R+=a,a.length}const _=O(e) -;if(!_)throw W(a.replace("{}",e)),Error('Unknown language: "'+e+'"') -;const v=V(_);let k="",N=o||v;const S={},M=new p.__emitter(p);(()=>{const e=[] -;for(let t=N;t!==_;t=t.parent)t.scope&&e.unshift(t.scope) -;e.forEach((e=>M.openNode(e)))})();let R="",j=0,A=0,I=0,T=!1;try{ -if(_.__emitTokens)_.__emitTokens(n,M);else{for(N.matcher.considerAll();;){ -I++,T?T=!1:N.matcher.considerAll(),N.matcher.lastIndex=A -;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(A,e.index),e) -;A=e.index+t}y(n.substring(A))}return M.finalize(),k=M.toHTML(),{language:e, -value:k,relevance:j,illegal:!1,_emitter:M,_top:N}}catch(t){ -if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), -illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A, -context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:k},_emitter:M};if(r)return{ -language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:N} -;throw t}}function x(e,t){t=t||p.languages||Object.keys(i);const n=(e=>{ -const t={value:Y(e),illegal:!1,relevance:0,_top:l,_emitter:new p.__emitter(p)} -;return t._emitter.addText(e),t})(e),s=t.filter(O).filter(k).map((t=>E(t,e,!1))) -;s.unshift(n);const o=s.sort(((e,t)=>{ -if(e.relevance!==t.relevance)return t.relevance-e.relevance -;if(e.language&&t.language){if(O(e.language).supersetOf===t.language)return 1 -;if(O(t.language).supersetOf===e.language)return-1}return 0})),[r,a]=o,c=r -;return c.secondBest=a,c}function w(e){let t=null;const n=(e=>{ -let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" -;const n=p.languageDetectRe.exec(t);if(n){const t=O(n[1]) -;return t||(X(a.replace("{}",n[1])), -X("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} -return t.split(/\s+/).find((e=>b(e)||O(e)))})(e);if(b(n))return -;if(N("before:highlightElement",{el:e,language:n -}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) -;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), -console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), -console.warn("The element with unescaped HTML:"), -console.warn(e)),p.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) -;t=e;const i=t.textContent,o=n?m(i,{language:n,ignoreIllegals:!0}):x(i) -;e.innerHTML=o.value,e.dataset.highlighted="yes",((e,t,n)=>{const i=t&&s[t]||n -;e.classList.add("hljs"),e.classList.add("language-"+i) -})(e,n,o.language),e.result={language:o.language,re:o.relevance, -relevance:o.relevance},o.secondBest&&(e.secondBest={ -language:o.secondBest.language,relevance:o.secondBest.relevance -}),N("after:highlightElement",{el:e,result:o,text:i})}let y=!1;function _(){ -"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(w):y=!0 -}function O(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]} -function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ -s[e.toLowerCase()]=t}))}function k(e){const t=O(e) -;return t&&!t.disableAutodetect}function N(e,t){const n=e;o.forEach((e=>{ -e[n]&&e[n](t)}))} -"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ -y&&_()}),!1),Object.assign(n,{highlight:m,highlightAuto:x,highlightAll:_, -highlightElement:w, -highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"), -G("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{p=Q(p,e)}, -initHighlighting:()=>{ -_(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, -initHighlightingOnLoad:()=>{ -_(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") -},registerLanguage:(e,t)=>{let s=null;try{s=t(n)}catch(t){ -if(W("Language definition for '{}' could not be registered.".replace("{}",e)), -!r)throw t;W(t),s=l} -s.name||(s.name=e),i[e]=s,s.rawDefinition=t.bind(null,n),s.aliases&&v(s.aliases,{ -languageName:e})},unregisterLanguage:e=>{delete i[e] -;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, -listLanguages:()=>Object.keys(i),getLanguage:O,registerAliases:v, -autoDetection:k,inherit:Q,addPlugin:e=>{(e=>{ -e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ -e["before:highlightBlock"](Object.assign({block:t.el},t)) -}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ -e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),o.push(e)}, -removePlugin:e=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),n.debugMode=()=>{ -r=!1},n.safeMode=()=>{r=!0},n.versionString="11.9.0",n.regex={concat:h, -lookahead:g,either:f,optional:d,anyNumberOfTimes:u} -;for(const t in j)"object"==typeof j[t]&&e(j[t]);return Object.assign(n,j),n -},ne=te({});return ne.newInstance=()=>te({}),ne}() -;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `cpp` grammar compiled for Highlight.js 11.9.0 */ -(()=>{var e=(()=>{"use strict";return e=>{const t=e.regex,a=e.COMMENT("//","$",{ -contains:[{begin:/\\\n/}] -}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="(?!struct)("+n+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={ -className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{ -begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ -begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", -end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ -begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ -className:"number",variants:[{ -begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)" -},{ -begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)" -}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ -keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" -},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{ -className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},u={ -className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0 -},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",p={ -type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"], -keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"], -literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], -_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] -},_={className:"function.dispatch",relevance:0,keywords:{ -_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] -}, -begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/)) -},m=[_,l,s,a,e.C_BLOCK_COMMENT_MODE,o,c],f={variants:[{begin:/=/,end:/;/},{ -begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], -keywords:p,contains:m.concat([{begin:/\(/,end:/\)/,keywords:p, -contains:m.concat(["self"]),relevance:0}]),relevance:0},g={className:"function", -begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, -keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:p,relevance:0},{ -begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{ -begin:/:/,endsWithParent:!0,contains:[c,o]},{relevance:0,match:/,/},{ -className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0, -contains:[a,e.C_BLOCK_COMMENT_MODE,c,o,s,{begin:/\(/,end:/\)/,keywords:p, -relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,c,o,s]}] -},s,a,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++", -aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"",keywords:p,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:p},{ -match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], -className:{1:"keyword",3:"title.class"}}])}}})();hljs.registerLanguage("cpp",e) -})();/*! `python` grammar compiled for Highlight.js 11.9.0 */ -(()=>{var e=(()=>{"use strict";return e=>{ -const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={ -$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s, -built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], -literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], -type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] -},t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, -end:/\}/,keywords:i,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ -className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, -end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, -relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ -begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, -end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, -contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, -contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+s.join("|"),g={ -className:"number",relevance:0,variants:[{ -begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ -begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ -begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` -},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` -}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:i, -contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ -className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, -end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i, -contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ -name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i, -illegal:/(<\/|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", -relevance:0},{match:/\bor\b/,scope:"keyword"},b,p,e.HASH_COMMENT_MODE,{ -match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[m]},{ -variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{ -match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class", -6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/, +/*! + Highlight.js v11.9.0 (git: b7ec4bfafc) + (c) 2006-2024 undefined and other contributors + License: BSD-3-Clause + */ +var hljs=function(){"use strict";function e(t){ +return t instanceof Map?t.clear=t.delete=t.set=()=>{ +throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{ +const i=t[n],s=typeof i;"object"!==s&&"function"!==s||Object.isFrozen(i)||e(i) +})),t}class t{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function n(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function i(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] +;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const s=e=>!!e.scope +;class o{constructor(e,t){ +this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ +this.buffer+=n(e)}openNode(e){if(!s(e))return;const t=((e,{prefix:t})=>{ +if(e.startsWith("language:"))return e.replace("language:","language-") +;if(e.includes(".")){const n=e.split(".") +;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") +}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)} +closeNode(e){s(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ +this.buffer+=``}}const r=(e={})=>{const t={children:[]} +;return Object.assign(t,e),t};class a{constructor(){ +this.rootNode=r(),this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const t=r({scope:e}) +;this.add(t),this.stack.push(t)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ +return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), +t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +a._collapse(e)})))}}class c extends a{constructor(e){super(),this.options=e} +addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){ +this.closeNode()}__addSublanguage(e,t){const n=e.root +;t&&(n.scope="language:"+t),this.add(n)}toHTML(){ +return new o(this,this.options).value()}finalize(){ +return this.closeAllNodes(),!0}}function l(e){ +return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")} +function u(e){return h("(?:",e,")*")}function d(e){return h("(?:",e,")?")} +function h(...e){return e.map((e=>l(e))).join("")}function f(...e){const t=(e=>{ +const t=e[e.length-1] +;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} +})(e);return"("+(t.capture?"":"?:")+e.map((e=>l(e))).join("|")+")"} +function p(e){return RegExp(e.toString()+"|").exec("").length-1} +const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function m(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n +;let i=l(e),s="";for(;i.length>0;){const e=b.exec(i);if(!e){s+=i;break} +s+=i.substring(0,e.index), +i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0], +"("===e[0]&&n++)}return s})).map((e=>`(${e})`)).join(t)} +const E="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",O={ +begin:"\\\\[\\s\\S]",relevance:0},v={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[O]},k={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[O]},N=(e,t,n={})=>{const s=i({scope:"comment",begin:e,end:t, +contains:[]},n);s.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const o=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return s.contains.push({begin:h(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s +},S=N("//","$"),M=N("/\\*","\\*/"),R=N("#","$");var j=Object.freeze({ +__proto__:null,APOS_STRING_MODE:v,BACKSLASH_ESCAPE:O,BINARY_NUMBER_MODE:{ +scope:"number",begin:_,relevance:0},BINARY_NUMBER_RE:_,COMMENT:N, +C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:S,C_NUMBER_MODE:{scope:"number", +begin:y,relevance:0},C_NUMBER_RE:y,END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ +t.data._beginMatch!==e[1]&&t.ignoreMatch()}}),HASH_COMMENT_MODE:R,IDENT_RE:E, +MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+x,relevance:0}, +NUMBER_MODE:{scope:"number",begin:w,relevance:0},NUMBER_RE:w, +PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},QUOTE_STRING_MODE:k,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/, +end:/\/[gimuy]*/,contains:[O,{begin:/\[/,end:/\]/,relevance:0,contains:[O]}]}, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const t=/^#![ ]*\// +;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),i({scope:"meta",begin:t, +end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, +TITLE_MODE:{scope:"title",begin:E,relevance:0},UNDERSCORE_IDENT_RE:x, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:x,relevance:0}});function A(e,t){ +"."===e.input[e.index-1]&&t.ignoreMatch()}function I(e,t){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function T(e,t){ +t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=A,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function L(e,t){ +Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function B(e,t){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function P(e,t){ +void 0===e.relevance&&(e.relevance=1)}const D=(e,t)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] +})),e.keywords=n.keywords,e.begin=h(n.beforeMatch,g(n.begin)),e.starts={ +relevance:0,contains:[Object.assign(n,{endsParent:!0})] +},e.relevance=0,delete n.beforeMatch +},H=["of","and","for","in","not","or","if","then","parent","list","value"],C="keyword" +;function $(e,t,n=C){const i=Object.create(null) +;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ +Object.assign(i,$(e[n],t,n))})),i;function s(e,n){ +t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") +;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ +return t?Number(t):(e=>H.includes(e.toLowerCase()))(e)?0:1}const z={},W=e=>{ +console.error(e)},X=(e,...t)=>{console.log("WARN: "+e,...t)},G=(e,t)=>{ +z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) +},K=Error();function F(e,t,{key:n}){let i=0;const s=e[n],o={},r={} +;for(let e=1;e<=t.length;e++)r[e+i]=s[e],o[e+i]=!0,i+=p(t[e-1]) +;e[n]=r,e[n]._emit=o,e[n]._multi=!0}function Z(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw W("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +K +;if("object"!=typeof e.beginScope||null===e.beginScope)throw W("beginScope must be object"), +K;F(e,e.begin,{key:"beginScope"}),e.begin=m(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw W("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +K +;if("object"!=typeof e.endScope||null===e.endScope)throw W("endScope must be object"), +K;F(e,e.end,{key:"endScope"}),e.end=m(e.end,{joinWith:""})}})(e)}function V(e){ +function t(t,n){ +return RegExp(l(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) +}class n{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,t){ +t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), +this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(m(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const t=this.matcherRe.exec(e);if(!t)return null +;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] +;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n +;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), +t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ +this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ +const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex +;let n=t.exec(e) +;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ +const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} +return n&&(this.regexIndex+=n.position+1, +this.regexIndex===this.count&&this.considerAll()),n}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=i(e.classNameAliases||{}),function n(o,r){const a=o +;if(o.isCompiled)return a +;[I,B,Z,D].forEach((e=>e(o,r))),e.compilerExtensions.forEach((e=>e(o,r))), +o.__beforeBegin=null,[T,L,P].forEach((e=>e(o,r))),o.isCompiled=!0;let c=null +;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords), +c=o.keywords.$pattern, +delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=$(o.keywords,e.case_insensitive)), +a.keywordPatternRe=t(c,!0), +r&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/), +o.end&&(a.endRe=t(a.end)), +a.terminatorEnd=l(a.end)||"",o.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+r.terminatorEnd)), +o.illegal&&(a.illegalRe=t(o.illegal)), +o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>i(e,{ +variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?i(e,{ +starts:e.starts?i(e.starts):null +}):Object.isFrozen(e)?i(e):e))("self"===e?o:e)))),o.contains.forEach((e=>{n(e,a) +})),o.starts&&n(o.starts,r),a.matcher=(e=>{const t=new s +;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ +return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ +constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} +const Y=n,Q=i,ee=Symbol("nomatch"),te=n=>{ +const i=Object.create(null),s=Object.create(null),o=[];let r=!0 +;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ +disableAutodetect:!0,name:"Plain text",contains:[]};let p={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:c};function b(e){ +return p.noHighlightRe.test(e)}function m(e,t,n){let i="",s="" +;"object"==typeof t?(i=e, +n=t.ignoreIllegals,s=t.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."), +G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +s=e,i=t),void 0===n&&(n=!0);const o={code:i,language:s};N("before:highlight",o) +;const r=o.result?o.result:E(o.language,o.code,n) +;return r.code=o.code,N("after:highlight",r),r}function E(e,n,s,o){ +const c=Object.create(null);function l(){if(!N.keywords)return void M.addText(R) +;let e=0;N.keywordPatternRe.lastIndex=0;let t=N.keywordPatternRe.exec(R),n="" +;for(;t;){n+=R.substring(e,t.index) +;const s=_.case_insensitive?t[0].toLowerCase():t[0],o=(i=s,N.keywords[i]);if(o){ +const[e,i]=o +;if(M.addText(n),n="",c[s]=(c[s]||0)+1,c[s]<=7&&(j+=i),e.startsWith("_"))n+=t[0];else{ +const n=_.classNameAliases[e]||e;u(t[0],n)}}else n+=t[0] +;e=N.keywordPatternRe.lastIndex,t=N.keywordPatternRe.exec(R)}var i +;n+=R.substring(e),M.addText(n)}function g(){null!=N.subLanguage?(()=>{ +if(""===R)return;let e=null;if("string"==typeof N.subLanguage){ +if(!i[N.subLanguage])return void M.addText(R) +;e=E(N.subLanguage,R,!0,S[N.subLanguage]),S[N.subLanguage]=e._top +}else e=x(R,N.subLanguage.length?N.subLanguage:null) +;N.relevance>0&&(j+=e.relevance),M.__addSublanguage(e._emitter,e.language) +})():l(),R=""}function u(e,t){ +""!==e&&(M.startScope(t),M.addText(e),M.endScope())}function d(e,t){let n=1 +;const i=t.length-1;for(;n<=i;){if(!e._emit[n]){n++;continue} +const i=_.classNameAliases[e[n]]||e[n],s=t[n];i?u(s,i):(R=s,l(),R=""),n++}} +function h(e,t){ +return e.scope&&"string"==typeof e.scope&&M.openNode(_.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(u(R,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +R=""):e.beginScope._multi&&(d(e.beginScope,t),R="")),N=Object.create(e,{parent:{ +value:N}}),N}function f(e,n,i){let s=((e,t)=>{const n=e&&e.exec(t) +;return n&&0===n.index})(e.endRe,i);if(s){if(e["on:end"]){const i=new t(e) +;e["on:end"](n,i),i.isMatchIgnored&&(s=!1)}if(s){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return f(e.parent,n,i)}function b(e){ +return 0===N.matcher.regexIndex?(R+=e[0],1):(T=!0,0)}function m(e){ +const t=e[0],i=n.substring(e.index),s=f(N,e,i);if(!s)return ee;const o=N +;N.endScope&&N.endScope._wrap?(g(), +u(t,N.endScope._wrap)):N.endScope&&N.endScope._multi?(g(), +d(N.endScope,e)):o.skip?R+=t:(o.returnEnd||o.excludeEnd||(R+=t), +g(),o.excludeEnd&&(R=t));do{ +N.scope&&M.closeNode(),N.skip||N.subLanguage||(j+=N.relevance),N=N.parent +}while(N!==s.parent);return s.starts&&h(s.starts,e),o.returnEnd?0:t.length} +let w={};function y(i,o){const a=o&&o[0];if(R+=i,null==a)return g(),0 +;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===a){ +if(R+=n.slice(o.index,o.index+1),!r){const t=Error(`0 width match regex (${e})`) +;throw t.languageName=e,t.badRule=w.rule,t}return 1} +if(w=o,"begin"===o.type)return(e=>{ +const n=e[0],i=e.rule,s=new t(i),o=[i.__beforeBegin,i["on:begin"]] +;for(const t of o)if(t&&(t(e,s),s.isMatchIgnored))return b(n) +;return i.skip?R+=n:(i.excludeBegin&&(R+=n), +g(),i.returnBegin||i.excludeBegin||(R=n)),h(i,e),i.returnBegin?0:n.length})(o) +;if("illegal"===o.type&&!s){ +const e=Error('Illegal lexeme "'+a+'" for mode "'+(N.scope||"")+'"') +;throw e.mode=N,e}if("end"===o.type){const e=m(o);if(e!==ee)return e} +if("illegal"===o.type&&""===a)return 1 +;if(I>1e5&&I>3*o.index)throw Error("potential infinite loop, way more iterations than matches") +;return R+=a,a.length}const _=O(e) +;if(!_)throw W(a.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const v=V(_);let k="",N=o||v;const S={},M=new p.__emitter(p);(()=>{const e=[] +;for(let t=N;t!==_;t=t.parent)t.scope&&e.unshift(t.scope) +;e.forEach((e=>M.openNode(e)))})();let R="",j=0,A=0,I=0,T=!1;try{ +if(_.__emitTokens)_.__emitTokens(n,M);else{for(N.matcher.considerAll();;){ +I++,T?T=!1:N.matcher.considerAll(),N.matcher.lastIndex=A +;const e=N.matcher.exec(n);if(!e)break;const t=y(n.substring(A,e.index),e) +;A=e.index+t}y(n.substring(A))}return M.finalize(),k=M.toHTML(),{language:e, +value:k,relevance:j,illegal:!1,_emitter:M,_top:N}}catch(t){ +if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), +illegal:!0,relevance:0,_illegalBy:{message:t.message,index:A, +context:n.slice(A-100,A+100),mode:t.mode,resultSoFar:k},_emitter:M};if(r)return{ +language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:N} +;throw t}}function x(e,t){t=t||p.languages||Object.keys(i);const n=(e=>{ +const t={value:Y(e),illegal:!1,relevance:0,_top:l,_emitter:new p.__emitter(p)} +;return t._emitter.addText(e),t})(e),s=t.filter(O).filter(k).map((t=>E(t,e,!1))) +;s.unshift(n);const o=s.sort(((e,t)=>{ +if(e.relevance!==t.relevance)return t.relevance-e.relevance +;if(e.language&&t.language){if(O(e.language).supersetOf===t.language)return 1 +;if(O(t.language).supersetOf===e.language)return-1}return 0})),[r,a]=o,c=r +;return c.secondBest=a,c}function w(e){let t=null;const n=(e=>{ +let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" +;const n=p.languageDetectRe.exec(t);if(n){const t=O(n[1]) +;return t||(X(a.replace("{}",n[1])), +X("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} +return t.split(/\s+/).find((e=>b(e)||O(e)))})(e);if(b(n))return +;if(N("before:highlightElement",{el:e,language:n +}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) +;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),p.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) +;t=e;const i=t.textContent,o=n?m(i,{language:n,ignoreIllegals:!0}):x(i) +;e.innerHTML=o.value,e.dataset.highlighted="yes",((e,t,n)=>{const i=t&&s[t]||n +;e.classList.add("hljs"),e.classList.add("language-"+i) +})(e,n,o.language),e.result={language:o.language,re:o.relevance, +relevance:o.relevance},o.secondBest&&(e.secondBest={ +language:o.secondBest.language,relevance:o.secondBest.relevance +}),N("after:highlightElement",{el:e,result:o,text:i})}let y=!1;function _(){ +"loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(w):y=!0 +}function O(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]} +function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +s[e.toLowerCase()]=t}))}function k(e){const t=O(e) +;return t&&!t.disableAutodetect}function N(e,t){const n=e;o.forEach((e=>{ +e[n]&&e[n](t)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +y&&_()}),!1),Object.assign(n,{highlight:m,highlightAuto:x,highlightAll:_, +highlightElement:w, +highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"), +G("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{p=Q(p,e)}, +initHighlighting:()=>{ +_(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +_(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(e,t)=>{let s=null;try{s=t(n)}catch(t){ +if(W("Language definition for '{}' could not be registered.".replace("{}",e)), +!r)throw t;W(t),s=l} +s.name||(s.name=e),i[e]=s,s.rawDefinition=t.bind(null,n),s.aliases&&v(s.aliases,{ +languageName:e})},unregisterLanguage:e=>{delete i[e] +;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, +listLanguages:()=>Object.keys(i),getLanguage:O,registerAliases:v, +autoDetection:k,inherit:Q,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ +e["before:highlightBlock"](Object.assign({block:t.el},t)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ +e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),o.push(e)}, +removePlugin:e=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),n.debugMode=()=>{ +r=!1},n.safeMode=()=>{r=!0},n.versionString="11.9.0",n.regex={concat:h, +lookahead:g,either:f,optional:d,anyNumberOfTimes:u} +;for(const t in j)"object"==typeof j[t]&&e(j[t]);return Object.assign(n,j),n +},ne=te({});return ne.newInstance=()=>te({}),ne}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `cpp` grammar compiled for Highlight.js 11.9.0 */ +(()=>{var e=(()=>{"use strict";return e=>{const t=e.regex,a=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),n="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="(?!struct)("+n+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={ +className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ +className:"number",variants:[{ +begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)" +},{ +begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)" +}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{ +className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},u={ +className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0 +},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",p={ +type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"], +keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"], +literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], +_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] +},_={className:"function.dispatch",relevance:0,keywords:{ +_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] +}, +begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/)) +},m=[_,l,s,a,e.C_BLOCK_COMMENT_MODE,o,c],f={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:p,contains:m.concat([{begin:/\(/,end:/\)/,keywords:p, +contains:m.concat(["self"]),relevance:0}]),relevance:0},g={className:"function", +begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:p,relevance:0},{ +begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{ +begin:/:/,endsWithParent:!0,contains:[c,o]},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0, +contains:[a,e.C_BLOCK_COMMENT_MODE,c,o,s,{begin:/\(/,end:/\)/,keywords:p, +relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,c,o,s]}] +},s,a,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++", +aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"",keywords:p,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:p},{ +match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], +className:{1:"keyword",3:"title.class"}}])}}})();hljs.registerLanguage("cpp",e) +})();/*! `python` grammar compiled for Highlight.js 11.9.0 */ +(()=>{var e=(()=>{"use strict";return e=>{ +const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s, +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, +end:/\}/,keywords:i,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+s.join("|"),g={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` +}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:i, +contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ +className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, +end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i, +contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i, +illegal:/(<\/|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},{match:/\bor\b/,scope:"keyword"},b,p,e.HASH_COMMENT_MODE,{ +match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[m]},{ +variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{ +match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class", +6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/, contains:[g,m,b]}]}}})();hljs.registerLanguage("python",e)})(); \ No newline at end of file diff --git a/code/run_prettify.js b/code/run_prettify.js deleted file mode 100644 index 8fc3e48..0000000 --- a/code/run_prettify.js +++ /dev/null @@ -1,64 +0,0 @@ -!function(){/* - - Copyright (C) 2013 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - Copyright (C) 2006 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -(function(){function aa(g){function r(){try{L.doScroll("left")}catch(ba){k.setTimeout(r,50);return}x("poll")}function x(r){if("readystatechange"!=r.type||"complete"==z.readyState)("load"==r.type?k:z)[B](n+r.type,x,!1),!l&&(l=!0)&&g.call(k,r.type||r)}var X=z.addEventListener,l=!1,E=!0,v=X?"addEventListener":"attachEvent",B=X?"removeEventListener":"detachEvent",n=X?"":"on";if("complete"==z.readyState)g.call(k,"lazy");else{if(z.createEventObject&&L.doScroll){try{E=!k.frameElement}catch(ba){}E&&r()}z[v](n+ -"DOMContentLoaded",x,!1);z[v](n+"readystatechange",x,!1);k[v](n+"load",x,!1)}}function T(){U&&aa(function(){var g=M.length;ca(g?function(){for(var r=0;r=c?parseInt(e.substring(1),8):"u"===c||"x"===c?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e); -return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function c(e){var c=e.substring(1,e.length-1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));e=[];var a="^"===c[0],b=["["];a&&b.push("^");for(var a=a?1:0,h=c.length;ap||122p||90p||122m[0]&&(m[1]+1>m[0]&&b.push("-"),b.push(f(m[1])));b.push("]");return b.join("")}function g(e){for(var a=e.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", -"g")),b=a.length,d=[],h=0,m=0;h/,null])):d.push(["com",/^#[^\r\n]*/,null,"#"]));a.cStyleComments&&(f.push(["com",/^\/\/[^\r\n]*/,null]),f.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/, -null]));if(c=a.regexLiterals){var g=(c=1|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+c+"])(?:[^/\\x5B\\x5C"+c+"]|\\x5C"+g+"|\\x5B(?:[^\\x5C\\x5D"+c+"]|\\x5C"+g+")*(?:\\x5D|$))+/")+")")])}(c=a.types)&&f.push(["typ",c]);c=(""+a.keywords).replace(/^ | $/g,"");c.length&&f.push(["kwd", -new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]);d.push(["pln",/^\s+/,null," \r\n\t\u00a0"]);c="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(c+="(?!s*/)");f.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(c),null]);return E(d,f)}function B(a,d,f){function c(a){var b= -a.nodeType;if(1==b&&!r.test(a.className))if("br"===a.nodeName.toLowerCase())g(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)c(a);else if((3==b||4==b)&&f){var e=a.nodeValue,d=e.match(n);d&&(b=e.substring(0,d.index),a.nodeValue=b,(e=e.substring(d.index+d[0].length))&&a.parentNode.insertBefore(q.createTextNode(e),a.nextSibling),g(a),b||a.parentNode.removeChild(a))}}function g(a){function c(a,b){var e=b?a.cloneNode(!1):a,p=a.parentNode;if(p){var p=c(p,1),d=a.nextSibling; -p.appendChild(e);for(var f=d;f;f=d)d=f.nextSibling,p.appendChild(f)}return e}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;a=c(a.nextSibling,0);for(var e;(e=a.parentNode)&&1===e.nodeType;)a=e;b.push(a)}for(var r=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,q=a.ownerDocument,k=q.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var b=[k],t=0;t=+g[1],d=/\n/g,r=a.a,k=r.length,f=0,q=a.c,n=q.length,c=0,b=a.g,t=b.length,v=0;b[t]=k;var u,e;for(e=u=0;e=m&&(c+=2);f>=p&&(v+=2)}}finally{h&&(h.style.display=a)}}catch(y){Q.console&&console.log(y&&y.stack||y)}}var Q="undefined"!==typeof window?window:{},J=["break,continue,do,else,for,if,return,while"],K=[[J,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],R=[K,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],L=[K,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], -M=[K,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],K=[K,"abstract,async,await,constructor,debugger,enum,eval,export,from,function,get,import,implements,instanceof,interface,let,null,of,set,undefined,var,with,yield,Infinity,NaN"], -N=[J,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],O=[J,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],J=[J,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],P=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, -S=/\S/,T=v({keywords:[R,M,L,K,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",N,O,J],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),V={};n(T,["default-code"]);n(E([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", -/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),"default-markup htm html mxml xhtml xml xsl".split(" "));n(E([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/], -["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);n(E([],[["atv",/^[\s\S]+/]]),["uq.val"]);n(v({keywords:R,hashComments:!0,cStyleComments:!0,types:P}),"c cc cpp cxx cyc m".split(" "));n(v({keywords:"null,true,false"}),["json"]);n(v({keywords:M,hashComments:!0,cStyleComments:!0, -verbatimStrings:!0,types:P}),["cs"]);n(v({keywords:L,cStyleComments:!0}),["java"]);n(v({keywords:J,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);n(v({keywords:N,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);n(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}), -["perl","pl","pm"]);n(v({keywords:O,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);n(v({keywords:K,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]);n(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);n(E([],[["str",/^[\s\S]+/]]), -["regex"]);var U=Q.PR={createSimpleLexer:E,registerLangHandler:n,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,f){f=f||!1;d=d||null;var c=document.createElement("div");c.innerHTML="
"+a+"
";c=c.firstChild;f&&B(c,f,!0);H({j:d,m:f,h:c,l:1,a:null,i:null,c:null,g:null}); -return c.innerHTML},prettyPrint:g=function(a,d){function f(){for(var c=Q.PR_SHOULD_USE_CONTINUATION?b.now()+250:Infinity;t - */ -.hljs { - background: #1E1E1E; - color: #DCDCDC -} -.hljs-keyword, -.hljs-literal, -.hljs-symbol, -.hljs-name { - color: #569CD6 -} -.hljs-link { - color: #569CD6; - text-decoration: underline -} -.hljs-built_in, -.hljs-type { - color: #4EC9B0 -} -.hljs-number, -.hljs-class { - color: #B8D7A3 -} -.hljs-string, -.hljs-meta .hljs-string { - color: #D69D85 -} -.hljs-regexp, -.hljs-template-tag { - color: #9A5334 -} -.hljs-subst, -.hljs-function, -.hljs-title, -.hljs-params, -.hljs-formula { - color: #DCDCDC -} -.hljs-comment, -.hljs-quote { - color: #57A64A; - font-style: italic -} -.hljs-doctag { - color: #608B4E -} -.hljs-meta, -.hljs-meta .hljs-keyword, -.hljs-tag { - color: #9B9B9B -} -.hljs-variable, -.hljs-template-variable { - color: #BD63C5 -} -.hljs-attr, -.hljs-attribute { - color: #9CDCFE -} -.hljs-section { - color: gold -} -.hljs-emphasis { - font-style: italic -} -.hljs-strong { - font-weight: bold -} -/*.hljs-code { - font-family:'Monospace'; -}*/ -.hljs-bullet, -.hljs-selector-tag, -.hljs-selector-id, -.hljs-selector-class, -.hljs-selector-attr, -.hljs-selector-pseudo { - color: #D7BA7D -} -.hljs-addition { - background-color: #144212; - display: inline-block; - width: 100% -} -.hljs-deletion { - background-color: #600; - display: inline-block; - width: 100% +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + * Visual Studio 2015 dark style + * Author: Nicolas LLOBERA + */ +.hljs { + background: #1E1E1E; + color: #DCDCDC +} +.hljs-keyword, +.hljs-literal, +.hljs-symbol, +.hljs-name { + color: #569CD6 +} +.hljs-link { + color: #569CD6; + text-decoration: underline +} +.hljs-built_in, +.hljs-type { + color: #4EC9B0 +} +.hljs-number, +.hljs-class { + color: #B8D7A3 +} +.hljs-string, +.hljs-meta .hljs-string { + color: #D69D85 +} +.hljs-regexp, +.hljs-template-tag { + color: #9A5334 +} +.hljs-subst, +.hljs-function, +.hljs-title, +.hljs-params, +.hljs-formula { + color: #DCDCDC +} +.hljs-comment, +.hljs-quote { + color: #57A64A; + font-style: italic +} +.hljs-doctag { + color: #608B4E +} +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-tag { + color: #9B9B9B +} +.hljs-variable, +.hljs-template-variable { + color: #BD63C5 +} +.hljs-attr, +.hljs-attribute { + color: #9CDCFE +} +.hljs-section { + color: gold +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +/*.hljs-code { + font-family:'Monospace'; +}*/ +.hljs-bullet, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #D7BA7D +} +.hljs-addition { + background-color: #144212; + display: inline-block; + width: 100% +} +.hljs-deletion { + background-color: #600; + display: inline-block; + width: 100% } \ No newline at end of file diff --git a/courses/advanced/change-splash.html b/courses/advanced/change-splash.html new file mode 100644 index 0000000..583c1cc --- /dev/null +++ b/courses/advanced/change-splash.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + Custom UPBGE Splash + + +

Custom UPBGE Splash

+

+ Yo in this tutorial we'll see how to change our game engine's splash screen. + If you have some experience compiling UPBGE you must find these steps easy.
+ If this is your first time compiling the engine, + you must check this page or + its going to be very difficult to setup. +

+

Requirements

+

+ You'll need: +

+

+

Setting Up

+

+ Go to the path where the source code is located. + Goto release -> datafiles and you'll find + splash.png with a size of 500x282 + and splash_2x.png with a size of 1000x563. + The first splash file is for regualar sized 1080p monitors and another 2x sized splash + is for big 4k monitors. Those images don't need to be same. +

+

Edit and export the image

+

+ We'll get some image from the internet and replace it with 1st and 2nd splash. + After downloading go to your favourite image editor and for the first image + set the canvas size's width to 500 and height to 282. + We need to set our image precision to unint8.png and + if you don't know how to set it, export the image.
+ Open MSPaint, + open the image and save it. It must set the precision mode to 8 bit unsigned integer.
+ Same applies to the splash_2x.png file but make sure the image width is 1000 + and height is 563. +

+
+

+

+ Setting the image precision to unint8.png is necessary + or your build will crash. You also need to have your images in + .png format. +

+
+

+ If you haven't put the files in this directory, + rename the original as something so + your's don't overwrite them and paste the files there. +

+

Building

+

+ Now for the last step, open up Visual Studio and build by + setting the build type from Debug to + Release, select + CMakePredefinedTargets and go to + Build -> Build -> 3 INSTALL.
+ If you're building for the first time, it might take up to 1½ hour and + if you've built more than once it should take a few moments. +

+
+ +
Splash Screen Replaced
+
+

+ Have fun! +

+ + + + + + + \ No newline at end of file diff --git a/courses/advanced/compile-upbge.html b/courses/advanced/compile-upbge.html index 1688d78..6f0eedc 100644 --- a/courses/advanced/compile-upbge.html +++ b/courses/advanced/compile-upbge.html @@ -40,7 +40,7 @@

Setting Up

After the installation has been completed, Open Visual Studio. To make sure everything is working, we need some smol c++ code.

-
#include <windows.h>
+	
#include <windows.h>
 #include <iostream>
 int main()
 {
@@ -53,7 +53,7 @@ 

Setting Up

It must be working. Now you need to install CMake for making a .sln file.

-

.sln or solution file

+

A solution is a structure for organizing projects in Visual Studio. The solution maintains the state information for projects in two files: @@ -76,7 +76,7 @@

Setting Up

As highlighted, it is recommended to add it to PATH for all users.

-

PATH

+

PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories @@ -144,7 +144,7 @@

Setting Up

Compiling upbge by Kitsuy
-

First time building

+

If you're building UPBGE for the first time, it may take upto 1-2 hours. After you build them, diff --git a/courses/advanced/intro.html b/courses/advanced/intro.html index ade61aa..15805a3 100644 --- a/courses/advanced/intro.html +++ b/courses/advanced/intro.html @@ -21,15 +21,21 @@

01Compile UPBGE

Editing source code and building UPBGE.

+ +
  • +
    02Change Splash
    +

    Changing UPBGE splash screen and avoiding crashes after compiling.

    +
  • +
    -
    + \ No newline at end of file diff --git a/courses/tutorials/character-physics.html b/courses/tutorials/character-physics.html index 93cb600..566040a 100644 --- a/courses/tutorials/character-physics.html +++ b/courses/tutorials/character-physics.html @@ -1,179 +1,179 @@ - - - - - - - - - - - - - - - - - - Character Control - - -

    Character Control

    -

    - We will make character physics controller which is - KX_CharacterWrapper type. - This allows us to check if the character has landed, - control number of jumps it can do, etc. -

    -

    Setup

    -

    - Select the cube, change it's physics type to Character, drag it up on the - Z axis to around 3-4.
    -

    -

    Logic Bricks

    -

    - To setup the logic bricks, we need to know how the player will - be controller. My guess is something like this. -

    -
    - logic bricks setup -
    Logic Bricks Setup
    -
    -

    - The keyboard keys will be controlled with python. -

    -

    Coding

    -

    - Import the game engine module, define our python controller and owner. -

    -
    try:
    -    import Range
    -except:
    -    import bge as Range
    -
    -cont = Range.logic.getCurrentController()
    -own = cont.owner
    -
    -def move():
    -    pass
    -

    - The move function will run in a loop. - Next we need to move our character when the keyboard sensors is triggered. -

    -
    def move():
    -    keyboard = cont.sensors["Keyboard"] # Get sensor as "keyboard"
    -    y = 0 # Forward / Backward
    -    z = 0 # Turn
    -    jump = (0,0,0) # Jump Direction
    -    if keyboard.positive: # If keyboard is triggered
    -        if 45 in keyboard.inputs: # W key
    -            y = 1/8
    -        if 23 in keyboard.inputs: # A key
    -            z = 1/8
    -        if 41 in keyboard.inputs: # S key
    -            y = -1/8
    -        if 26 in keyboard.inputs: # D key
    -            z = -1/8
    -        if 8 in keyboard.inputs:  # SPACE key
    -            pass # Do nothing, will be implemented later
    -        else: # Reset everything
    -        	x = 0
    -        	z = 0
    -        	jump = 0
    -

    - Here, we've setup the movement when the keyboard is pressed. - Now we need to get the character ID. -

    -
    -

    -

    - Getting the character ID is mandatory or the character you control becomes - KX_GameObject. -

    -
    -
    player = Range.constraints.getCharacter(own)
    -

    - We got our character ID, now we need to implement the player movement. -

    -
    def move():
    -    keyboard = cont.sensors["Keyboard"]
    -    y = 0
    -    z = 0
    -    jump = (0,0,0)
    -    if keyboard.positive:
    -        if 45 in keyboard.inputs:
    -            y = 1/8
    -        if 23 in keyboard.inputs:
    -            z = 1/8
    -        if 41 in keyboard.inputs:
    -            y = -1/8
    -        if 26 in keyboard.inputs:
    -            z = -1/8
    -        if 8 in keyboard.inputs:
    -            player.jump() # The proper jump
    -    else:
    -        x = 0
    -        z = 0
    -        jump = 0
    -                    
    -    player.walkDirection = (0,y,0) # Movement but in world coordinates
    -    own.applyRotation((0,0,z), True) # Turn left and right
    -

    - If you run the script, the character moves in world coordinates, - to solve this we multiply worldOrientation - that returns us Matrix with the tuple (0,y,0) - which will be converted into a Vector with mathutils module. -

    -
    player.walkDirection = own.worldOrientation * Vector((0,y,0))
    -

    - And we create a property that returns us the - KX_CharacterWrapper.onGround as True or False. -

    -
    own["landed"] = player.onGround
    -

    - And the final code looks like this. -

    -
    try:
    -    import Range
    -except:
    -    import bge as Range
    -
    -from mathutils import Vector
    -    
    -cont = Range.logic.getCurrentController()
    -own = cont.owner
    -player = Range.constraints.getCharacter(own)
    -
    -def move():
    -    keyboard = cont.sensors["Keyboard"]
    -    y = 0
    -    z = 0
    -    jump = (0,0,0)
    -    if keyboard.positive:
    -        if 45 in keyboard.inputs:
    -            y = 1/8
    -        if 23 in keyboard.inputs:
    -            z = 1/8
    -        if 41 in keyboard.inputs:
    -            y = -1/8
    -        if 26 in keyboard.inputs:
    -            z = -1/8
    -        if 8 in keyboard.inputs:
    -            player.jump()
    -    else:
    -        x = 0
    -        z = 0
    -        jump = 0
    -                    
    -    player.walkDirection = own.worldOrientation * Vector((0,y,0))
    -    own.applyRotation((0,0,z), True)
    -    own["landed"] = player.onGround
    -

    - Download the project file. -

    - - - - - + + + + + + + + + + + + + + + + + + Character Control + + +

    Character Control

    +

    + We will make character physics controller which is + KX_CharacterWrapper type. + This allows us to check if the character has landed, + control number of jumps it can do, etc. +

    +

    Setup

    +

    + Select the cube, change it's physics type to Character, drag it up on the + Z axis to around 3-4.
    +

    +

    Logic Bricks

    +

    + To setup the logic bricks, we need to know how the player will + be controller. My guess is something like this. +

    +
    + logic bricks setup +
    Logic Bricks Setup
    +
    +

    + The keyboard keys will be controlled with python. +

    +

    Coding

    +

    + Import the game engine module, define our python controller and owner. +

    +
    try:
    +    import Range
    +except:
    +    import bge as Range
    +
    +cont = Range.logic.getCurrentController()
    +own = cont.owner
    +
    +def move():
    +    pass
    +

    + The move function will run in a loop. + Next we need to move our character when the keyboard sensors is triggered. +

    +
    def move():
    +    keyboard = cont.sensors["Keyboard"] # Get sensor as "keyboard"
    +    y = 0 # Forward / Backward
    +    z = 0 # Turn
    +    jump = (0,0,0) # Jump Direction
    +    if keyboard.positive: # If keyboard is triggered
    +        if 45 in keyboard.inputs: # W key
    +            y = 1/8
    +        if 23 in keyboard.inputs: # A key
    +            z = 1/8
    +        if 41 in keyboard.inputs: # S key
    +            y = -1/8
    +        if 26 in keyboard.inputs: # D key
    +            z = -1/8
    +        if 8 in keyboard.inputs:  # SPACE key
    +            pass # Do nothing, will be implemented later
    +        else: # Reset everything
    +        	x = 0
    +        	z = 0
    +        	jump = 0
    +

    + Here, we've setup the movement when the keyboard is pressed. + Now we need to get the character ID. +

    +
    +

    +

    + Getting the character ID is mandatory or the character you control becomes + KX_GameObject. +

    +
    +
    player = Range.constraints.getCharacter(own)
    +

    + We got our character ID, now we need to implement the player movement. +

    +
    def move():
    +    keyboard = cont.sensors["Keyboard"]
    +    y = 0
    +    z = 0
    +    jump = (0,0,0)
    +    if keyboard.positive:
    +        if 45 in keyboard.inputs:
    +            y = 1/8
    +        if 23 in keyboard.inputs:
    +            z = 1/8
    +        if 41 in keyboard.inputs:
    +            y = -1/8
    +        if 26 in keyboard.inputs:
    +            z = -1/8
    +        if 8 in keyboard.inputs:
    +            player.jump() # The proper jump
    +    else:
    +        x = 0
    +        z = 0
    +        jump = 0
    +                    
    +    player.walkDirection = (0,y,0) # Movement but in world coordinates
    +    own.applyRotation((0,0,z), True) # Turn left and right
    +

    + If you run the script, the character moves in world coordinates, + to solve this we multiply worldOrientation + that returns us Matrix with the tuple (0,y,0) + which will be converted into a Vector with mathutils module. +

    +
    player.walkDirection = own.worldOrientation * Vector((0,y,0))
    +

    + And we create a property that returns us the + KX_CharacterWrapper.onGround as True or False. +

    +
    own["landed"] = player.onGround
    +

    + And the final code looks like this. +

    +
    try:
    +    import Range
    +except:
    +    import bge as Range
    +
    +from mathutils import Vector
    +    
    +cont = Range.logic.getCurrentController()
    +own = cont.owner
    +player = Range.constraints.getCharacter(own)
    +
    +def move():
    +    keyboard = cont.sensors["Keyboard"]
    +    y = 0
    +    z = 0
    +    jump = (0,0,0)
    +    if keyboard.positive:
    +        if 45 in keyboard.inputs:
    +            y = 1/8
    +        if 23 in keyboard.inputs:
    +            z = 1/8
    +        if 41 in keyboard.inputs:
    +            y = -1/8
    +        if 26 in keyboard.inputs:
    +            z = -1/8
    +        if 8 in keyboard.inputs:
    +            player.jump()
    +    else:
    +        x = 0
    +        z = 0
    +        jump = 0
    +                    
    +    player.walkDirection = own.worldOrientation * Vector((0,y,0))
    +    own.applyRotation((0,0,z), True)
    +    own["landed"] = player.onGround
    +

    + Download the project file. +

    + + + + + \ No newline at end of file diff --git a/courses/tutorials/py-ingame-cheats.html b/courses/tutorials/py-ingame-cheats.html index c93a890..4c67172 100644 --- a/courses/tutorials/py-ingame-cheats.html +++ b/courses/tutorials/py-ingame-cheats.html @@ -1,296 +1,296 @@ - - - - - - - - - - - - - - - - - - - - - In-Game Cheats - - -

    Implementing Cheats

    -

    - In this tutorial, we're going to implement cheat codes inside our game project.
    - Without any further ado, let's get started. -

    -
    - -
    Cheat activated in GTA San Andreas
    -
    -

    Keyboard

    -
    Logic Bricks Setup
    -

    - Open up the logic bricks, add an always sensor, - a keyboard sensor which is going to record - our keystrokes and a python controller having it's script type to - Module. Create a new property, name it as record - whose data type will be boolean and another property named as - cheats whose type will be string.
    - Moving to the keyboard sensor we've just added, we need to record the keys we're - pressing so enable All Keys. The Log Toggle field asks for a property - which let's us to record the keystrokes, if the property is false we - can't record our keystrokes, - so go ahead select our property record - in that field and set it True (just enable it lol). The Target field asks - for a property with which we record our keystrokes, so select our - cheats property in that field.
    -

    -
    - -
    Logic Bricks Setup
    -
    -

    - If you run the game, you can that our keystrokes are being recorded. -

    -
    - -
    Logic Bricks Setup Working
    -
    -
    Python Setup
    -

    - Create a new file, name it as cheats.py, - define the necessary like below. -

    -
    try:
    -    import Range # I'm using Range Engine
    -except:
    -    import bge as Range
    -
    -cont = Range.logic.getCurrentController()
    -own = cont.owner # define owner
    -
    -def main(): # got the owner, so no need of using "main(cont)"
    -    pass
    -

    - Now the main runs in a continuos loop, we need to check - our cheat code. Before that I'd like to create some code for our cheats. -

      -
    • nogravity - sets the world gravity to 0
    • -
    • iamspeed - player moves very fast
    • -
    • abigcube - spawns a big cube
    • -
    -

    -

    - Here are some cheats, the first two cheats changes the default value. If - we type the same cheat again, we must be able to get it back to normal mode.
    - Now to implement it, we check the if any of the above cheats was typed - we trigger what must be triggered. -

    -
    def main():
    -    if "nogravity" in own["cheats"].lower() and own.scene.gravity.z != 0.0:
    -        own.scene.gravity = 0,0,0
    -    elif "nogravity" in own["cheats"].lower() and own.scene.gravity.z == 0.0:
    -        own.scene.gravity = (0,0,-9.80)
    -

    - Here our cube floats when the cheat is enabled but when you type again, - gravity doesn't go back to normal. So we need to clear the text field by doing so. -

    -
    def main():
    -    if "nogravity" in own["cheats"].lower() and own.scene.gravity.z != 0.0:
    -        own.scene.gravity = 0,0,0
    -        own["cheats"] = ""
    -    elif "nogravity" in own["cheats"].lower() and own.scene.gravity.z == 0.0:
    -        own.scene.gravity = (0,0,-9.80)
    -        own["cheats"] = ""
    -

    - If this was hard to understand, let me break it down for ya: -

      -
    • We have a function that runs in a loop.
    • -
    • Checks if the user typed that certain cheat.
    • -

      - Checks if the user typed nogravity and - if the gravity's Z axis was not equal to zero.
      - .lower() converts any letters that - are randomly in capital to lower. -

      -
    • we set the gravity to zero in Vector form as (0,0,0).
    • -
    • Clear the cheats property's texts.
    • -
    • Checks if user typed the same cheat.
    • -

      - We check if the user typed the same cheat again and the gravity's Z axis - is equal to zero. -

      -
    • - Then we set gravity back to -9.80. -
    • -
    • Clear the texts.
    • -
    -

    -

    - And then we need to implement two more cheats, which are iamspeed that - changes the player's speed and abigcube that spawns a big cube in front - of the player. But we haven't created the player's movement, so we'll make one. - You can skip to this part if you're not interested making the movement - code. -

    -
    if "speed" not in own:
    -    own["speed"] = 1/8 # int type, this is important
    -
    -def move():
    -    keysdown = Range.logic.keyboard.activeInputs
    -    x = 0
    -    z = 0
    -
    -    if 45 in keysdown: # 45 = W key
    -        y = speed
    -    else:
    -        y = 0.0
    -    
    -    if 23 in keysdown and not 26 in keysdown:
    -        zt = speed
    -    elif 26 in keysdown and not 23 in keysdown:
    -        zt = -speed
    -    else:
    -        zt = 0.0
    -    
    -    own.applyMovement((x, y, z), True)
    -    own.applyRotation((0.0, 0.0, zt), True)
    -

    - The code might look complicated but lemme break it down for you. -

      -
    • W.I.P.
    • -
    -

    -

    - For part you need an always sensor that runs in a loop, enable true - level triggering. -

    -

    - Now we've created the player movement, now we check if the player typed - "iamspeed" -

    -
    def main():
    -    cheats = own["cheats"].lower() # Defined to avoid lengthy lines
    -
    -    if "nogravity" in cheats and own.scene.gravity.z != 0.0:
    -        own.scene.gravity = (0, 0, 0)
    -        own["cheats"] = ""
    -    elif "nogravity" in cheats and own.scene.gravity.z == 0.0:
    -        own.scene.gravity = (0, 0, -9.80)
    -        own["cheats"] = ""
    -
    -    # "iamspeed" Part here
    -    elif "iamspeed" in cheats and own["speed"] == 1/8:
    -        own["speed"] = 1
    -        own["cheats"] = ""
    -    elif "iamspeed" in cheats and own["speed"] == 1:
    -        own["speed"] = 1/8
    -        own["cheats"] = ""
    -    else:
    -        pass
    -

    - The main reason own["speed"] = 1/8 is it results in - shorter float whose value will be 0.128. If you have - defined it speed property as 0.1 the float be will something like - 0.100000022912 or so, which can be frustrating to - check that cheat for the second time.
    - And if you have defined speed instead of - own["speed"] you might enounter - UnboundLocalError. -

    -

    - Now for the final part, we're going to spawn a big cube infront of the player. - For that we need to copy the orientation and position of the player. Instead - of writing code that need to deal with Vector, we can - simply parent an Empty to the player. Must be looking something like this. -

    -
    - -
    Example setup for spawing objects
    -
    -

    - Now we need to add the code that spawns the object... -

    -
    # Spawn object mechanism
    -elif "abigcube" in cheats:
    -    own.scene.addObject("dacube", "spawn", 0)
    -    own["cheats"] = ""
    -

    - In the addObject(), we put the name of our object - we're going to spawn as string and name of spawning object as string which is - used to copy the position, rotation and scale to spawn "dacube". -

    -
    try:
    -    import Range
    -except:
    -    import bge as Range
    -
    -from mathutils import Vector
    -
    -cont = Range.logic.getCurrentController()
    -own = cont.owner
    -
    -if "speed" not in own:
    -    own["speed"] = 1/8
    -    own.addDebugProperty("speed", True)
    -
    -def main():
    -    cheats = own["cheats"].lower()
    -
    -    if "nogravity" in cheats and own.scene.gravity.z != 0.0:
    -        own.scene.gravity = (0, 0, 0)
    -        own["cheats"] = ""
    -    elif "nogravity" in cheats and own.scene.gravity.z == 0.0:
    -        own.scene.gravity = (0, 0, -9.80)
    -        own["cheats"] = ""
    -    elif "iamspeed" in cheats and own["speed"] == 1/8:
    -        own["speed"] = 1
    -        own["cheats"] = ""
    -    elif "iamspeed" in cheats and own["speed"] == 1:
    -        own["speed"] = 1/8
    -        own["cheats"] = ""
    -    elif "abigcube" in cheats:
    -        spawn = own.scene.objects["spawn"]
    -        own.scene.addObject("dacube", spawn, 0)
    -        own["cheats"] = ""
    -    else:
    -        pass
    -
    -def move():
    -    keysdown = Range.logic.keyboard.activeInputs
    -    x = 0
    -    z = 0
    -
    -    if 45 in keysdown: # 45 = W key
    -        y = own["speed"]
    -    else:
    -        y = 0.0
    -    
    -    if 23 in keysdown and not 26 in keysdown:
    -        zt = own["speed"]
    -    elif 26 in keysdown and not 23 in keysdown:
    -        zt = -own["speed"]
    -    else:
    -        zt = 0.0
    -    
    -    own.applyMovement((x, y, z), True)
    -    own.applyRotation((0.0, 0.0, zt), True)
    -
    - -
    Final Result
    -
    -

    - Must be working.... - Download project file here. -

    - - - - - - - + + + + + + + + + + + + + + + + + + + + + In-Game Cheats + + +

    Implementing Cheats

    +

    + In this tutorial, we're going to implement cheat codes inside our game project.
    + Without any further ado, let's get started. +

    +
    + +
    Cheat activated in GTA San Andreas
    +
    +

    Keyboard

    +
    Logic Bricks Setup
    +

    + Open up the logic bricks, add an always sensor, + a keyboard sensor which is going to record + our keystrokes and a python controller having it's script type to + Module. Create a new property, name it as record + whose data type will be boolean and another property named as + cheats whose type will be string.
    + Moving to the keyboard sensor we've just added, we need to record the keys we're + pressing so enable All Keys. The Log Toggle field asks for a property + which let's us to record the keystrokes, if the property is false we + can't record our keystrokes, + so go ahead select our property record + in that field and set it True (just enable it lol). The Target field asks + for a property with which we record our keystrokes, so select our + cheats property in that field.
    +

    +
    + +
    Logic Bricks Setup
    +
    +

    + If you run the game, you can that our keystrokes are being recorded. +

    +
    + +
    Logic Bricks Setup Working
    +
    +
    Python Setup
    +

    + Create a new file, name it as cheats.py, + define the necessary like below. +

    +
    try:
    +    import Range # I'm using Range Engine
    +except:
    +    import bge as Range
    +
    +cont = Range.logic.getCurrentController()
    +own = cont.owner # define owner
    +
    +def main(): # got the owner, so no need of using "main(cont)"
    +    pass
    +

    + Now the main runs in a continuos loop, we need to check + our cheat code. Before that I'd like to create some code for our cheats. +

      +
    • nogravity - sets the world gravity to 0
    • +
    • iamspeed - player moves very fast
    • +
    • abigcube - spawns a big cube
    • +
    +

    +

    + Here are some cheats, the first two cheats changes the default value. If + we type the same cheat again, we must be able to get it back to normal mode.
    + Now to implement it, we check the if any of the above cheats was typed + we trigger what must be triggered. +

    +
    def main():
    +    if "nogravity" in own["cheats"].lower() and own.scene.gravity.z != 0.0:
    +        own.scene.gravity = 0,0,0
    +    elif "nogravity" in own["cheats"].lower() and own.scene.gravity.z == 0.0:
    +        own.scene.gravity = (0,0,-9.80)
    +

    + Here our cube floats when the cheat is enabled but when you type again, + gravity doesn't go back to normal. So we need to clear the text field by doing so. +

    +
    def main():
    +    if "nogravity" in own["cheats"].lower() and own.scene.gravity.z != 0.0:
    +        own.scene.gravity = 0,0,0
    +        own["cheats"] = ""
    +    elif "nogravity" in own["cheats"].lower() and own.scene.gravity.z == 0.0:
    +        own.scene.gravity = (0,0,-9.80)
    +        own["cheats"] = ""
    +

    + If this was hard to understand, let me break it down for ya: +

      +
    • We have a function that runs in a loop.
    • +
    • Checks if the user typed that certain cheat.
    • +

      + Checks if the user typed nogravity and + if the gravity's Z axis was not equal to zero.
      + .lower() converts any letters that + are randomly in capital to lower. +

      +
    • we set the gravity to zero in Vector form as (0,0,0).
    • +
    • Clear the cheats property's texts.
    • +
    • Checks if user typed the same cheat.
    • +

      + We check if the user typed the same cheat again and the gravity's Z axis + is equal to zero. +

      +
    • + Then we set gravity back to -9.80. +
    • +
    • Clear the texts.
    • +
    +

    +

    + And then we need to implement two more cheats, which are iamspeed that + changes the player's speed and abigcube that spawns a big cube in front + of the player. But we haven't created the player's movement, so we'll make one. + You can skip to this part if you're not interested making the movement + code. +

    +
    if "speed" not in own:
    +    own["speed"] = 1/8 # int type, this is important
    +
    +def move():
    +    keysdown = Range.logic.keyboard.activeInputs
    +    x = 0
    +    z = 0
    +
    +    if 45 in keysdown: # 45 = W key
    +        y = speed
    +    else:
    +        y = 0.0
    +    
    +    if 23 in keysdown and not 26 in keysdown:
    +        zt = speed
    +    elif 26 in keysdown and not 23 in keysdown:
    +        zt = -speed
    +    else:
    +        zt = 0.0
    +    
    +    own.applyMovement((x, y, z), True)
    +    own.applyRotation((0.0, 0.0, zt), True)
    +

    + The code might look complicated but lemme break it down for you. +

      +
    • W.I.P.
    • +
    +

    +

    + For part you need an always sensor that runs in a loop, enable true + level triggering. +

    +

    + Now we've created the player movement, now we check if the player typed + "iamspeed" +

    +
    def main():
    +    cheats = own["cheats"].lower() # Defined to avoid lengthy lines
    +
    +    if "nogravity" in cheats and own.scene.gravity.z != 0.0:
    +        own.scene.gravity = (0, 0, 0)
    +        own["cheats"] = ""
    +    elif "nogravity" in cheats and own.scene.gravity.z == 0.0:
    +        own.scene.gravity = (0, 0, -9.80)
    +        own["cheats"] = ""
    +
    +    # "iamspeed" Part here
    +    elif "iamspeed" in cheats and own["speed"] == 1/8:
    +        own["speed"] = 1
    +        own["cheats"] = ""
    +    elif "iamspeed" in cheats and own["speed"] == 1:
    +        own["speed"] = 1/8
    +        own["cheats"] = ""
    +    else:
    +        pass
    +

    + The main reason own["speed"] = 1/8 is it results in + shorter float whose value will be 0.128. If you have + defined it speed property as 0.1 the float be will something like + 0.100000022912 or so, which can be frustrating to + check that cheat for the second time.
    + And if you have defined speed instead of + own["speed"] you might enounter + UnboundLocalError. +

    +

    + Now for the final part, we're going to spawn a big cube infront of the player. + For that we need to copy the orientation and position of the player. Instead + of writing code that need to deal with Vector, we can + simply parent an Empty to the player. Must be looking something like this. +

    +
    + +
    Example setup for spawing objects
    +
    +

    + Now we need to add the code that spawns the object... +

    +
    # Spawn object mechanism
    +elif "abigcube" in cheats:
    +    own.scene.addObject("dacube", "spawn", 0)
    +    own["cheats"] = ""
    +

    + In the addObject(), we put the name of our object + we're going to spawn as string and name of spawning object as string which is + used to copy the position, rotation and scale to spawn "dacube". +

    +
    try:
    +    import Range
    +except:
    +    import bge as Range
    +
    +from mathutils import Vector
    +
    +cont = Range.logic.getCurrentController()
    +own = cont.owner
    +
    +if "speed" not in own:
    +    own["speed"] = 1/8
    +    own.addDebugProperty("speed", True)
    +
    +def main():
    +    cheats = own["cheats"].lower()
    +
    +    if "nogravity" in cheats and own.scene.gravity.z != 0.0:
    +        own.scene.gravity = (0, 0, 0)
    +        own["cheats"] = ""
    +    elif "nogravity" in cheats and own.scene.gravity.z == 0.0:
    +        own.scene.gravity = (0, 0, -9.80)
    +        own["cheats"] = ""
    +    elif "iamspeed" in cheats and own["speed"] == 1/8:
    +        own["speed"] = 1
    +        own["cheats"] = ""
    +    elif "iamspeed" in cheats and own["speed"] == 1:
    +        own["speed"] = 1/8
    +        own["cheats"] = ""
    +    elif "abigcube" in cheats:
    +        spawn = own.scene.objects["spawn"]
    +        own.scene.addObject("dacube", spawn, 0)
    +        own["cheats"] = ""
    +    else:
    +        pass
    +
    +def move():
    +    keysdown = Range.logic.keyboard.activeInputs
    +    x = 0
    +    z = 0
    +
    +    if 45 in keysdown: # 45 = W key
    +        y = own["speed"]
    +    else:
    +        y = 0.0
    +    
    +    if 23 in keysdown and not 26 in keysdown:
    +        zt = own["speed"]
    +    elif 26 in keysdown and not 23 in keysdown:
    +        zt = -own["speed"]
    +    else:
    +        zt = 0.0
    +    
    +    own.applyMovement((x, y, z), True)
    +    own.applyRotation((0.0, 0.0, zt), True)
    +
    + +
    Final Result
    +
    +

    + Must be working.... + Download project file here. +

    + + + + + + + \ No newline at end of file diff --git a/courses/tutorials/py-toggle-buttons.html b/courses/tutorials/py-toggle-buttons.html index 66eb80a..b5a2dfe 100644 --- a/courses/tutorials/py-toggle-buttons.html +++ b/courses/tutorials/py-toggle-buttons.html @@ -1,145 +1,145 @@ - - - - - - - - - - - - - - - - - - Toggle Buttons - - -

    Toggle Buttons

    -

    - In this tutorial website, we'll be creating the toggle mechanism using python. - We will turn on and off a light. -

    -

    Scene Setup

    -

    - Create a dark environment and add a spot lamp, creating a dark environment - is simple as pie! Delete everything in the scene, set the horizon and zenith - colors to some dark color, add a plane and scale it to 10, add a spot lamp - and bring it on Z axis to something around 10. Should be looking something like - this. -

    -
    - -
    Dark Environment
    -
    -

    Coding

    -

    - Let's import our module, define the current controller, get the owner and create - a function that runs in a loop named as main(). -

    -
    try:
    -    import Range
    -except:
    -    import bge as Range
    -    
    -cont = Range.logic.getCurrentController()
    -own = cont.owner
    -
    -def main():
    -    pass
    -

    - We need to get our object's name which is a lamp and in python, its type will be - KX_LightObject which is a subclass of - KX_GameObject. -

    -
    def init():
    -    if "init" not in own or own["init"] == False:
    -        own["init"] = True
    -        own["toggle"] = True
    -

    - We create a function that runs once even though its wrapped with a sensor - that runs in a loop. We also created a property that controls the light.
    - Now let's code the toggle mechanism, let's work on the looping function. - We check for the user's input and if that certain input was triggered, - we turn on the light.
    - Let's add an always and a keyboard sensor to the controllers. - It looks something like this. -

    -
    - -
    Logic Bricks Setup
    -
    -
    def main():
    -    if own.sensors["Keyboard"].positive and own["toggle"] == False:
    -        own["toggle"] = True
    -    elif own.sensors["Keyboard"].positive and own["toggle"] == True:
    -        own["toggle"] = False
    -

    - Here, we check that if the keyboard sensor is triggered and if the property - toggle was False, we set it to True and - vice versa. -

    -
    def main():
    -    if own.sensors["Keyboard"].positive and own["toggle"] == False:
    -        own["toggle"] = True
    -    elif own.sensors["Keyboard"].positive and own["toggle"] == True:
    -        own["toggle"] = False
    -
    -    # Light toggle part goes below
    -    elif own["toggle"] == True:
    -        own.scene.objects["Spot"].energy = 1.0
    -    elif own["toggle"] == False:
    -        own.scene.objects["Spot"].energy = 0.0
    -    else:
    -        pass
    -

    - Here we check that if the property was True - we set the light's energy to 1.0, light attribute - needs a float when pass the value to it. Then on the third elif it happens - vice versa. Finally if none of them takes place, we do nothing.
    - Here is the full code. -

    -
    try:
    -    import Range
    -except:
    -    import bge as Range
    -    
    -cont = Range.logic.getCurrentController()
    -own = cont.owner
    -
    -def init():
    -    if "init" not in own or own["init"] == False:
    -        own["init"] = True
    -        own["toggle"] = True
    -
    -def main():
    -    if own.sensors["Keyboard"].positive and own["toggle"] == False:
    -        own["toggle"] = True
    -    elif own.sensors["Keyboard"].positive and own["toggle"] == True:
    -        own["toggle"] = False
    -    elif own["toggle"] == True:
    -        own.scene.objects["Spot"].energy = 1.0
    -    elif own["toggle"] == False:
    -        own.scene.objects["Spot"].energy = 0.0
    -    else:
    -        pass
    -

    - The final result should look something like this. -

    -
    - -
    Final Result
    -
    -

    - Download the project file. -

    - - - - - + + + + + + + + + + + + + + + + + + Toggle Buttons + + +

    Toggle Buttons

    +

    + In this tutorial website, we'll be creating the toggle mechanism using python. + We will turn on and off a light. +

    +

    Scene Setup

    +

    + Create a dark environment and add a spot lamp, creating a dark environment + is simple as pie! Delete everything in the scene, set the horizon and zenith + colors to some dark color, add a plane and scale it to 10, add a spot lamp + and bring it on Z axis to something around 10. Should be looking something like + this. +

    +
    + +
    Dark Environment
    +
    +

    Coding

    +

    + Let's import our module, define the current controller, get the owner and create + a function that runs in a loop named as main(). +

    +
    try:
    +    import Range
    +except:
    +    import bge as Range
    +    
    +cont = Range.logic.getCurrentController()
    +own = cont.owner
    +
    +def main():
    +    pass
    +

    + We need to get our object's name which is a lamp and in python, its type will be + KX_LightObject which is a subclass of + KX_GameObject. +

    +
    def init():
    +    if "init" not in own or own["init"] == False:
    +        own["init"] = True
    +        own["toggle"] = True
    +

    + We create a function that runs once even though its wrapped with a sensor + that runs in a loop. We also created a property that controls the light.
    + Now let's code the toggle mechanism, let's work on the looping function. + We check for the user's input and if that certain input was triggered, + we turn on the light.
    + Let's add an always and a keyboard sensor to the controllers. + It looks something like this. +

    +
    + +
    Logic Bricks Setup
    +
    +
    def main():
    +    if own.sensors["Keyboard"].positive and own["toggle"] == False:
    +        own["toggle"] = True
    +    elif own.sensors["Keyboard"].positive and own["toggle"] == True:
    +        own["toggle"] = False
    +

    + Here, we check that if the keyboard sensor is triggered and if the property + toggle was False, we set it to True and + vice versa. +

    +
    def main():
    +    if own.sensors["Keyboard"].positive and own["toggle"] == False:
    +        own["toggle"] = True
    +    elif own.sensors["Keyboard"].positive and own["toggle"] == True:
    +        own["toggle"] = False
    +
    +    # Light toggle part goes below
    +    elif own["toggle"] == True:
    +        own.scene.objects["Spot"].energy = 1.0
    +    elif own["toggle"] == False:
    +        own.scene.objects["Spot"].energy = 0.0
    +    else:
    +        pass
    +

    + Here we check that if the property was True + we set the light's energy to 1.0, light attribute + needs a float when pass the value to it. Then on the third elif it happens + vice versa. Finally if none of them takes place, we do nothing.
    + Here is the full code. +

    +
    try:
    +    import Range
    +except:
    +    import bge as Range
    +    
    +cont = Range.logic.getCurrentController()
    +own = cont.owner
    +
    +def init():
    +    if "init" not in own or own["init"] == False:
    +        own["init"] = True
    +        own["toggle"] = True
    +
    +def main():
    +    if own.sensors["Keyboard"].positive and own["toggle"] == False:
    +        own["toggle"] = True
    +    elif own.sensors["Keyboard"].positive and own["toggle"] == True:
    +        own["toggle"] = False
    +    elif own["toggle"] == True:
    +        own.scene.objects["Spot"].energy = 1.0
    +    elif own["toggle"] == False:
    +        own.scene.objects["Spot"].energy = 0.0
    +    else:
    +        pass
    +

    + The final result should look something like this. +

    +
    + +
    Final Result
    +
    +

    + Download the project file. +

    + + + + + \ No newline at end of file diff --git a/courses/tutorials/set-resolution.html b/courses/tutorials/set-resolution.html index 2af2bd2..a10c7a2 100644 --- a/courses/tutorials/set-resolution.html +++ b/courses/tutorials/set-resolution.html @@ -1,142 +1,142 @@ - - - - - - Set Resolution - - -

    Set Resolution

    -

    - In this tutorial, we will get and set screen resolution of our game, - let's get started.
    - -

    -

    - Fire up the game engine, create a new text file, save it as - reso.py, import the game engine module - and necessary stuff -

    -
    try:
    -    import Range as bge
    -except:
    -    import bge
    -
    -cont = bge.logic.getCurrentController()
    -own = cont.owner
    -
    -def reso(cont):
    -    pass
    -

    - Now we get the screen resolution and print it on a property. - I am a lazy guy, i dont create property by going to logic bricks, - create a property, create a new one, blah blah blah...
    - No, I got a new method for you where u can create a property inside python and - debug without touching logic bricks! For that, we create two new properties named - as "X" and "Y" which will be inside a init function. -

    -
    def init(cont):
    -    if "init" not in own or own["init"] != True:
    -        own["init"] = True
    -        # List of properties goes here.
    -

    - So we've created an "init" function that must run only once, it only runs once - even if true level triggering was enabled in a sensor. Let's add some properties - and debug them. -

    -
    def init(cont):
    -    if "init" not in own or own["init"] != True:
    -        own["init"] = True
    -        own["X"] = 0.0 # There's a ".", so it's a float
    -        own["Y"] = 0.0 # Float type
    -

    - Here we've added two properties and its value is not 0 - but 0.0 which means, its a floating point integers. - If you assign a True or False, - the list would be a boolean type property.
    - Now let's debug the property. -

    -
    def init(cont):
    -    if "init" not in own or own["init"] != True:
    -        own["init"] = True
    -        own["X"] = 0.0 # There's a ".", so it's a float
    -        own["Y"] = 0.0 # Float type
    -        own.addDebugProperty("X", True)
    -        own.addDebugProperty("Y", True)
    -

    - To check if this works, add an always sensor, two python controller with - script type set as Module, name the first one as - reso.init, the second one as - reso.reso and connect them. -

    -
    - -
    Logic bricks setup
    -
    -

    - Now we'll move to the looping function, - we'll get the screen width and height. -

    -
    def reso(cont):
    -    own["X"] = bge.render.getWindowWidth()
    -    own["Y"] = bge.render.getWindowHeight()
    -

    - Now we got our info, now we need to set the resolution. We can either - set the resolution either with a property or just be defining them, - We'll go to our init function and create two - new properties that sets the resolution. -

    -
    def init(cont):
    -    if "init" not in own or own["init"] != True:
    -        own["init"] = True
    -        own["X"] = 0.0 # There's a ".", so it's a float
    -        own["Y"] = 0.0 # Float type
    -        own.addDebugProperty("X", True)
    -        own.addDebugProperty("Y", True)
    -        if "width" or "height" not in own:
    -            own["width"] = 640 # Integer type
    -            own["height"] = 480 # Integer type
    -

    - In this code we check that if the property width - or height doesn't exist, we create them - and set their values as 640x480.
    - Now let's jump to the looping function, and write the code that set the - resolution we need. We should not be keep setting the resolution, so we need - a keyboard sensor that does the job once. Add a keyboard sensor, - enable Tap, - connect it with the reso.reso controller. -

    -
    def reso(cont):
    -    own["X"] = bge.render.getWindowWidth()
    -    own["Y"] = bge.render.getWindowHeight()
    -    if cont.sensors["Keyboard"].positive:
    -        bge.render.setWindowSize(own["width"], own["height"])
    -
    -

    Note

    -

    - render.setWindowSize() only works - in the standalone player mode, not in the in-built embedded player. -

    -
    -

    - Now launch the game in standalone player mode and trigger the keyboard, - it must set the window size to the values we've set.
    -

    -
    - -
    Working setup of changing resolution
    -
    -

    - Download the project file. -

    - - - - - + + + + + + Set Resolution + + +

    Set Resolution

    +

    + In this tutorial, we will get and set screen resolution of our game, + let's get started.
    + +

    +

    + Fire up the game engine, create a new text file, save it as + reso.py, import the game engine module + and necessary stuff +

    +
    try:
    +    import Range as bge
    +except:
    +    import bge
    +
    +cont = bge.logic.getCurrentController()
    +own = cont.owner
    +
    +def reso(cont):
    +    pass
    +

    + Now we get the screen resolution and print it on a property. + I am a lazy guy, i dont create property by going to logic bricks, + create a property, create a new one, blah blah blah...
    + No, I got a new method for you where u can create a property inside python and + debug without touching logic bricks! For that, we create two new properties named + as "X" and "Y" which will be inside a init function. +

    +
    def init(cont):
    +    if "init" not in own or own["init"] != True:
    +        own["init"] = True
    +        # List of properties goes here.
    +

    + So we've created an "init" function that must run only once, it only runs once + even if true level triggering was enabled in a sensor. Let's add some properties + and debug them. +

    +
    def init(cont):
    +    if "init" not in own or own["init"] != True:
    +        own["init"] = True
    +        own["X"] = 0.0 # There's a ".", so it's a float
    +        own["Y"] = 0.0 # Float type
    +

    + Here we've added two properties and its value is not 0 + but 0.0 which means, its a floating point integers. + If you assign a True or False, + the list would be a boolean type property.
    + Now let's debug the property. +

    +
    def init(cont):
    +    if "init" not in own or own["init"] != True:
    +        own["init"] = True
    +        own["X"] = 0.0 # There's a ".", so it's a float
    +        own["Y"] = 0.0 # Float type
    +        own.addDebugProperty("X", True)
    +        own.addDebugProperty("Y", True)
    +

    + To check if this works, add an always sensor, two python controller with + script type set as Module, name the first one as + reso.init, the second one as + reso.reso and connect them. +

    +
    + +
    Logic bricks setup
    +
    +

    + Now we'll move to the looping function, + we'll get the screen width and height. +

    +
    def reso(cont):
    +    own["X"] = bge.render.getWindowWidth()
    +    own["Y"] = bge.render.getWindowHeight()
    +

    + Now we got our info, now we need to set the resolution. We can either + set the resolution either with a property or just be defining them, + We'll go to our init function and create two + new properties that sets the resolution. +

    +
    def init(cont):
    +    if "init" not in own or own["init"] != True:
    +        own["init"] = True
    +        own["X"] = 0.0 # There's a ".", so it's a float
    +        own["Y"] = 0.0 # Float type
    +        own.addDebugProperty("X", True)
    +        own.addDebugProperty("Y", True)
    +        if "width" or "height" not in own:
    +            own["width"] = 640 # Integer type
    +            own["height"] = 480 # Integer type
    +

    + In this code we check that if the property width + or height doesn't exist, we create them + and set their values as 640x480.
    + Now let's jump to the looping function, and write the code that set the + resolution we need. We should not be keep setting the resolution, so we need + a keyboard sensor that does the job once. Add a keyboard sensor, + enable Tap, + connect it with the reso.reso controller. +

    +
    def reso(cont):
    +    own["X"] = bge.render.getWindowWidth()
    +    own["Y"] = bge.render.getWindowHeight()
    +    if cont.sensors["Keyboard"].positive:
    +        bge.render.setWindowSize(own["width"], own["height"])
    +
    +

    Note

    +

    + render.setWindowSize() only works + in the standalone player mode, not in the in-built embedded player. +

    +
    +

    + Now launch the game in standalone player mode and trigger the keyboard, + it must set the window size to the values we've set.
    +

    +
    + +
    Working setup of changing resolution
    +
    +

    + Download the project file. +

    + + + + + \ No newline at end of file diff --git a/img/bgeninja.svg b/img/bgeninja.svg index beaeea2..f24845c 100644 --- a/img/bgeninja.svg +++ b/img/bgeninja.svg @@ -1,22 +1,22 @@ - - - - - - - - - + + + + + + + + + diff --git a/img/bgeninja2.svg b/img/bgeninja2.svg index edcaf88..1586984 100644 --- a/img/bgeninja2.svg +++ b/img/bgeninja2.svg @@ -1,7 +1,7 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/img/range.svg b/img/range.svg index 346091b..173b175 100644 --- a/img/range.svg +++ b/img/range.svg @@ -1,50 +1,50 @@ - - - - + + + + diff --git a/img/upbge.svg b/img/upbge.svg index 05ee68c..482cdf0 100644 --- a/img/upbge.svg +++ b/img/upbge.svg @@ -1,109 +1,109 @@ - - - UPBGE Logo - - - - - - image/svg+xml - - UPBGE Logo - https://upbge.org/ - - - - - - - - - - - - - - - - - - - - + + + UPBGE Logo + + + + + + image/svg+xml + + UPBGE Logo + https://upbge.org/ + + + + + + + + + + + + + + + + + + + + diff --git a/index.html b/index.html index 124d88a..d5233bd 100644 --- a/index.html +++ b/index.html @@ -81,7 +81,7 @@

    Tutorials for game engine

    4

    Advanced Stuff

    -

    Advanced programming and understanding what the game engine source code does too!

    +

    Game engine source code related stuff.

    diff --git a/style3.css b/style3.css index fa8b32f..04c912b 100644 --- a/style3.css +++ b/style3.css @@ -291,21 +291,21 @@ a:hover{ background: linear-gradient(to right, forestgreen, darkgreen); } .know .what::before{ - content: "❓ Know"; + content: "Know ❓"; } .note .what{ background: linear-gradient(to right, midnightblue, royalblue); } .note .what::before{ - content: "📝 Note"; + content: "Note 📝"; } .warning .what{ - background: orangered; + background: linear-gradient(to right, orangered, #b82c1a); } .warning .what::before{ - content: "❗ Warning"; + content: "Warning ❗"; } iframe{ @@ -321,12 +321,20 @@ iframe{ @keyframes target_{ 0%{ background: transparent; + color: inherit; + } + 25%{ + color: black; } 50%{ - background: rgba(255, 255, 255, 0.2); + background: yellow; + } + 75%{ + color: black; } 100%{ background: transparent; + color: inherit; } } /*Making the site more responsive almost on any device*/ diff --git a/vs2015.css b/vs2015.css index 2c2cf04..e135e49 100644 --- a/vs2015.css +++ b/vs2015.css @@ -1,100 +1,100 @@ -pre code.hljs { - display: block; - overflow-x: auto; - padding: 1em -} -code.hljs { - padding: 3px 5px -} -/* - * Visual Studio 2015 dark style - * Author: Nicolas LLOBERA - */ -.hljs { - background: #1E1E1E; - color: #DCDCDC -} -.hljs-keyword, -.hljs-literal, -.hljs-symbol, -.hljs-name { - color: #569CD6 -} -.hljs-link { - color: #569CD6; - text-decoration: underline -} -.hljs-built_in, -.hljs-type { - color: #4EC9B0 -} -.hljs-number, -.hljs-class { - color: #B8D7A3 -} -.hljs-string, -.hljs-meta .hljs-string { - color: #D69D85 -} -.hljs-regexp, -.hljs-template-tag { - color: #9A5334 -} -.hljs-subst, -.hljs-function, -.hljs-title, -.hljs-params, -.hljs-formula { - color: #DCDCDC -} -.hljs-comment, -.hljs-quote { - color: #57A64A; - font-style: italic -} -.hljs-doctag { - color: #608B4E -} -.hljs-meta, -.hljs-meta .hljs-keyword, -.hljs-tag { - color: #9B9B9B -} -.hljs-variable, -.hljs-template-variable { - color: #BD63C5 -} -.hljs-attr, -.hljs-attribute { - color: #9CDCFE -} -.hljs-section { - color: gold -} -.hljs-emphasis { - font-style: italic -} -.hljs-strong { - font-weight: bold -} -/*.hljs-code { - font-family:'Monospace'; -}*/ -.hljs-bullet, -.hljs-selector-tag, -.hljs-selector-id, -.hljs-selector-class, -.hljs-selector-attr, -.hljs-selector-pseudo { - color: #D7BA7D -} -.hljs-addition { - background-color: #144212; - display: inline-block; - width: 100% -} -.hljs-deletion { - background-color: #600; - display: inline-block; - width: 100% +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em +} +code.hljs { + padding: 3px 5px +} +/* + * Visual Studio 2015 dark style + * Author: Nicolas LLOBERA + */ +.hljs { + background: #1E1E1E; + color: #DCDCDC +} +.hljs-keyword, +.hljs-literal, +.hljs-symbol, +.hljs-name { + color: #569CD6 +} +.hljs-link { + color: #569CD6; + text-decoration: underline +} +.hljs-built_in, +.hljs-type { + color: #4EC9B0 +} +.hljs-number, +.hljs-class { + color: #B8D7A3 +} +.hljs-string, +.hljs-meta .hljs-string { + color: #D69D85 +} +.hljs-regexp, +.hljs-template-tag { + color: #9A5334 +} +.hljs-subst, +.hljs-function, +.hljs-title, +.hljs-params, +.hljs-formula { + color: #DCDCDC +} +.hljs-comment, +.hljs-quote { + color: #57A64A; + font-style: italic +} +.hljs-doctag { + color: #608B4E +} +.hljs-meta, +.hljs-meta .hljs-keyword, +.hljs-tag { + color: #9B9B9B +} +.hljs-variable, +.hljs-template-variable { + color: #BD63C5 +} +.hljs-attr, +.hljs-attribute { + color: #9CDCFE +} +.hljs-section { + color: gold +} +.hljs-emphasis { + font-style: italic +} +.hljs-strong { + font-weight: bold +} +/*.hljs-code { + font-family:'Monospace'; +}*/ +.hljs-bullet, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #D7BA7D +} +.hljs-addition { + background-color: #144212; + display: inline-block; + width: 100% +} +.hljs-deletion { + background-color: #600; + display: inline-block; + width: 100% } \ No newline at end of file