JS落叶动画代码分析

秋天到了,秋高气爽的季节。我们来做一个落叶动画吧!来迎接秋天的到来

文字可以更换。 

1.目录如下 

 

 在线演示:点击我在线演示

images两张照片,首先,你得要准备一个vscode编辑器。和一个chorme浏览器或edge浏览器。

在目录下新建一个index.html文件,完整代码如下:


<!--
Important:This is sample code demonstrating API, technology or techniques in development.
Although this sample code has been reviewed for technical accuracy, it is not 
final. Apple is supplying this information to help you plan for the adoption of 
the technologies and programming interfaces described herein. This information 
is subject to change, and software implemented based on this sample code should 
be tested with final operating system software and final documentation. Newer 
versions of this sample code may be provided with future seeds of the API or 
technology. For information about updates to this and other developer 
documentation, view the New & Updated sidebars in subsequent documentation seeds.
--><!--
File: index.html
Abstract: Content layout for the leaves sample.Displays a set of colored leaves falling down.Version: 1.0Disclaimer: IMPORTANT:  This Apple software is supplied to you by
Apple Inc. ("Apple") in consideration of your agreement to the
following terms, and your use, installation, modification or
redistribution of this Apple software constitutes acceptance of these
terms.  If you do not agree with these terms, please do not use,
install, modify or redistribute this Apple software.In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc.
may be used to endorse or promote products derived from the Apple
Software without specific prior written permission from Apple.  Except
as expressly stated in this notice, no other rights or licenses, express
or implied, are granted by Apple herein, including but not limited to
any patent rights that may be infringed by your derivative works or by
other works in which the Apple Software may be incorporated.The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.Copyright (C) 2008 Apple Inc. All Rights Reserved.-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><html><head><title>HTML5树叶飘落动画 HTML5动画经典演示页面</title><meta http-equiv="Content-type" content="text/html; charset=utf-8"><meta name="viewport" content="width=500px, initial-scale=0.64"><link rel="apple-touch-icon" href="images/apple-touch-icon.png"/><!-- The leaves.css file animates the leaves --><link rel="stylesheet" href="leaves.css" type="text/css" media="screen" charset="utf-8"><!-- The leaves.js file creates the leaves --><script src="leaves.js" type="text/javascript" charset="utf-8"></script></head><body><div style="text-align:center;clear:both">
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
</div><div id="container"><!-- The container is dynamically populated using the init function in leaves.js --><!-- Its dimensions and position are defined using its id selector in leaves.css --><div id="leafContainer"></div><!-- its appearance, dimensions, and position are defined using its id selector in leaves.css --><div id="message"><em>这是基于c++的落叶动画</em></div></div><script src="http://demo.itivy.com/follow.js" type="text/javascript"></script><div style="width:700px;margin:10px auto 20px auto;padding:0 0 0 380px;overflow:hidden"><!-- Baidu Button BEGIN --><div id="bdshare" class="bdshare_t bds_tools_32 get-codes-bdshare" style="margin:10px 0 0 -4px"><a class="bds_tsina"></a><a class="bds_tqq"></a><a class="bds_renren"></a><a class="bds_qzone"></a><a class="bds_douban"></a><a class="bds_xg"></a><span class="bds_more">更多</span><a class="shareCount"></a></div>
<script type="text/javascript" id="bdshare_js" data="type=tools" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + new Date().getHours
();
</script>
<!-- Baidu Button END -->
</div></body>
</html>

根据 此文件注释可以删除

第二步:创建JavaScript文件
在你的项目文件夹中创建一个名为leaves.js的文件,并添加以下代码

此代码是落叶落下的动画,然后消失

/*
Important:This is sample code demonstrating API, technology or techniques in development.
Although this sample code has been reviewed for technical accuracy, it is not 
final. Apple is supplying this information to help you plan for the adoption of 
the technologies and programming interfaces described herein. This information 
is subject to change, and software implemented based on this sample code should 
be tested with final operating system software and final documentation. Newer 
versions of this sample code may be provided with future seeds of the API or 
technology. For information about updates to this and other developer 
documentation, view the New & Updated sidebars in subsequent documentation seeds.
*//*
File: Leaves.js
Abstract: Defines JavaScript functionality for the leaves sample.Creates all the leaves but do not animate them. Determines whichspin animation should be applied to each leaf.
Version: 1.0Disclaimer: IMPORTANT:  This Apple software is supplied to you by
Apple Inc. ("Apple") in consideration of your agreement to the
following terms, and your use, installation, modification or
redistribution of this Apple software constitutes acceptance of these
terms.  If you do not agree with these terms, please do not use,
install, modify or redistribute this Apple software.In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc.
may be used to endorse or promote products derived from the Apple
Software without specific prior written permission from Apple.  Except
as expressly stated in this notice, no other rights or licenses, express
or implied, are granted by Apple herein, including but not limited to
any patent rights that may be infringed by your derivative works or by
other works in which the Apple Software may be incorporated.The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.Copyright (C) 2008 Apple Inc. All Rights Reserved.*//* Define the number of leaves to be used in the animation */
const NUMBER_OF_LEAVES = 30;/* Called when the "Falling Leaves" page is completely loaded.
*/
function init()
{/* Get a reference to the element that will contain the leaves */var container = document.getElementById('leafContainer');/* Fill the empty container with new leaves */for (var i = 0; i < NUMBER_OF_LEAVES; i++) {container.appendChild(createALeaf());}
}/*Receives the lowest and highest values of a range andreturns a random integer that falls within that range.
*/
function randomInteger(low, high)
{return low + Math.floor(Math.random() * (high - low));
}/*Receives the lowest and highest values of a range andreturns a random float that falls within that range.
*/
function randomFloat(low, high)
{return low + Math.random() * (high - low);
}/*Receives a number and returns its CSS pixel value.
*/
function pixelValue(value)
{return value + 'px';
}/*Returns a duration value for the falling animation.
*/function durationValue(value)
{return value + 's';
}/*Uses an img element to create each leaf. "Leaves.css" implements two spin animations for the leaves: clockwiseSpin and counterclockwiseSpinAndFlip. Thisfunction determines which of these spin animations should be applied to each leaf.*/
function createALeaf()
{/* Start by creating a wrapper div, and an empty img element */var leafDiv = document.createElement('div');var image = document.createElement('img');/* Randomly choose a leaf image and assign it to the newly created element */image.src = 'images/realLeaf' + randomInteger(1, 5) + '.png';leafDiv.style.top = "-100px";/* Position the leaf at a random location along the screen */leafDiv.style.left = pixelValue(randomInteger(0, 500));/* Randomly choose a spin animation */var spinAnimationName = (Math.random() < 0.5) ? 'clockwiseSpin' : 'counterclockwiseSpinAndFlip';/* Set the -webkit-animation-name property with these values */leafDiv.style.webkitAnimationName = 'fade, drop';image.style.webkitAnimationName = spinAnimationName;/* Figure out a random duration for the fade and drop animations */var fadeAndDropDuration = durationValue(randomFloat(5, 11));/* Figure out another random duration for the spin animation */var spinDuration = durationValue(randomFloat(4, 8));/* Set the -webkit-animation-duration property with these values */leafDiv.style.webkitAnimationDuration = fadeAndDropDuration + ', ' + fadeAndDropDuration;var leafDelay = durationValue(randomFloat(0, 5));leafDiv.style.webkitAnimationDelay = leafDelay + ', ' + leafDelay;image.style.webkitAnimationDuration = spinDuration;// add the <img> to the <div>leafDiv.appendChild(image);/* Return this img element so it can be added to the document */return leafDiv;
}/* Calls the init function when the "Falling Leaves" page is full loaded */
window.addEventListener('load', init, false);

leaves.css

/*
Important:This is sample code demonstrating API, technology or techniques in development.
Although this sample code has been reviewed for technical accuracy, it is not 
final. Apple is supplying this information to help you plan for the adoption of 
the technologies and programming interfaces described herein. This information 
is subject to change, and software implemented based on this sample code should 
be tested with final operating system software and final documentation. Newer 
versions of this sample code may be provided with future seeds of the API or 
technology. For information about updates to this and other developer 
documentation, view the New & Updated sidebars in subsequent documentation seeds.
*//*
File: leaves.css
Abstract: Defines CSS properties for the leaves sample.Applies animations to the leaves. Defines the appearance, position, and dimensions of all div elements on the "Falling Leaves -- Using CSS Animations and Transforms" page.Version: 1.0Disclaimer: IMPORTANT:  This Apple software is supplied to you by
Apple Inc. ("Apple") in consideration of your agreement to the
following terms, and your use, installation, modification or
redistribution of this Apple software constitutes acceptance of these
terms.  If you do not agree with these terms, please do not use,
install, modify or redistribute this Apple software.In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc.
may be used to endorse or promote products derived from the Apple
Software without specific prior written permission from Apple.  Except
as expressly stated in this notice, no other rights or licenses, express
or implied, are granted by Apple herein, including but not limited to
any patent rights that may be infringed by your derivative works or by
other works in which the Apple Software may be incorporated.The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.Copyright (C) 2008 Apple Inc. All Rights Reserved.*/body
{background-color: #4E4226;
}#container {position: relative;height: 700px;width: 500px;margin: 10px auto;overflow: hidden;border: 4px solid #5C090A;background: #4E4226 url('images/backgroundLeaves.jpg') no-repeat top left;
}/* Defines the position and dimensions of the leafContainer div */
#leafContainer 
{position: absolute;width: 100%;height: 100%;
}/* Defines the appearance, position, and dimensions of the message div */
#message
{position: absolute;top: 160px;width: 100%;height: 300px;background:transparent url('images/textBackground.png') repeat-x center;color: #5C090A;font-size: 220%;font-family: 'Georgia';text-align: center;padding: 20px 10px;-webkit-box-sizing: border-box;-webkit-background-size: 100% 100%;z-index: 1;
}p {margin: 15px;
}a
{color: #5C090A;text-decoration: none;
}/* Sets the color of the "Dino's Gardening Service" message */
em 
{font-weight: bold;font-style: normal;
}.phone {font-size: 150%;vertical-align: middle;
}/* This CSS rule is applied to all div elements in the leafContainer div.It styles and animates each leafDiv.
*/
#leafContainer > div 
{position: absolute;width: 100px;height: 100px;/* We use the following properties to apply the fade and drop animations to each leaf.Each of these properties takes two values. These values respectively match a settingfor fade and drop.*/-webkit-animation-iteration-count: infinite, infinite;-webkit-animation-direction: normal, normal;-webkit-animation-timing-function: linear, ease-in;
}/* This CSS rule is applied to all img elements directly inside div elements which aredirectly inside the leafContainer div. In other words, it matches the 'img' elementsinside the leafDivs which are created in the createALeaf() function.
*/
#leafContainer > div > img {position: absolute;width: 100px;height: 100px;/* We use the following properties to adjust the clockwiseSpin or counterclockwiseSpinAndFlipanimations on each leaf.The createALeaf function in the Leaves.js file determines whether a leaf has the clockwiseSpin or counterclockwiseSpinAndFlip animation.*/-webkit-animation-iteration-count: infinite;-webkit-animation-direction: alternate;-webkit-animation-timing-function: ease-in-out;-webkit-transform-origin: 50% -100%;
}/* Hides a leaf towards the very end of the animation */
@-webkit-keyframes fade
{/* Show a leaf while into or below 95 percent of the animation and hide it, otherwise */0%   { opacity: 1; }95%  { opacity: 1; }100% { opacity: 0; }
}/* Makes a leaf fall from -300 to 600 pixels in the y-axis */
@-webkit-keyframes drop
{/* Move a leaf to -300 pixels in the y-axis at the start of the animation */0%   { -webkit-transform: translate(0px, -50px); }/* Move a leaf to 600 pixels in the y-axis at the end of the animation */100% { -webkit-transform: translate(0px, 650px); }
}/* Rotates a leaf from -50 to 50 degrees in 2D space */
@-webkit-keyframes clockwiseSpin
{/* Rotate a leaf by -50 degrees in 2D space at the start of the animation */0%   { -webkit-transform: rotate(-50deg); }/*  Rotate a leaf by 50 degrees in 2D space at the end of the animation */100% { -webkit-transform: rotate(50deg); }
}/* Flips a leaf and rotates it from 50 to -50 degrees in 2D space */
@-webkit-keyframes counterclockwiseSpinAndFlip 
{/* Flip a leaf and rotate it by 50 degrees in 2D space at the start of the animation */0%   { -webkit-transform: scale(-1, 1) rotate(50deg); }/* Flip a leaf and rotate it by -50 degrees in 2D space at the end of the animation */100% { -webkit-transform: scale(-1, 1) rotate(-50deg); }
}

谢谢大家最近的支持!博主最近有点忙。 图片资源如下

backgroundLeaves.jpg

realLeaf1.png

 realLeaf2.png

realLeaf3.png

realLeaf4.png

textBackground.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1537280.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

PyTorch 激活函数及非线性变换详解

激活函数是深度学习模型的重要组成部分&#xff0c;它们引入非线性&#xff0c;从而使模型能够更好地拟合复杂的数据模式。本文将详细介绍激活函数的作用、常见类型、经典应用示例&#xff0c;并比较它们的优缺点。 激活函数的作用 激活函数的主要作用是引入非线性变换&#…

理解高并发

文章目录 1、如何理解高并发2、高并发的关键指标3、高并发系统设计的目标是什么&#xff1f;1_宏观目标2_微观目标1.性能指标2.可用性指标3.可扩展性指标 4、高并发的实践方案有哪些&#xff1f;1_通用的设计方法1.纵向扩展&#xff08;scale-up&#xff09;2.横向扩展&#xf…

ROS组合导航笔记2:使用外部定位系统

在上一单元中&#xff0c;我们了解了如何合并不同传感器的数据以生成机器人的姿势估计。因此&#xff0c;基本上&#xff0c;我们介绍了图表的以下部分&#xff0c;其中向 robot_localization 节点提供了不同的传感器&#xff0c;以便通过卡尔曼滤波器进行合并。 但是...图表的…

背包问题 总结详解

就是感觉之前 dp 的 blog 太乱了整理一下。 0-1 背包 例题:P1048 朴素算法 思路 对于一个物品&#xff0c;我们可以选&#xff0c;也可以不选。 我们用表示第 i 件物品的重量&#xff0c;表示第 i 件物品的价值。 考虑表示前 i 件物品放入容量为j的背包中的最大价值。 如…

【图像匹配】基于Harris算法的图像匹配,matlab实现

博主简介&#xff1a;matlab图像代码项目合作&#xff08;扣扣&#xff1a;3249726188&#xff09; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 本次案例是基于基于Harris算法的图像匹配&#xff0c;用matlab实现。 一、案例背景和算法介绍 …

Observability:日志管理的最佳实践 - 利用日志更快地解决问题

作者&#xff1a;来自 Elastic Luca Wintergerst•David Hope•Bahubali Shetti 在当今快速发展的软件开发环境中&#xff0c;高效的日志管理对于维护系统可靠性和性能至关重要。随着基础架构和应用程序组件的不断扩展和复杂化&#xff0c;运营和开发团队的职责也不断增加且越来…

yolov8区域入侵检测警报系统-pyside6可视化界面

yolov8区域入侵检测警报系统&#xff0c;是微智启软件工作室基于yolov8目标追踪和pyside6开发&#xff0c;在window的pycharm或者vscode里运行&#xff0c;可以应用于多个领域&#xff0c;检测统计物体个数以及入侵语音警报。 功能介绍 可以应用于 江河流域危险区域禁止游泳警…

利用AI技术提升ISP处理:图像质量的四大关键模块

随着智能手机和数码相机的飞速发展&#xff0c;图像质量成为了影响用户体验的关键因素之一。图像信号处理&#xff08;ISP&#xff0c;Image Signal Processing&#xff09;管道是将图像传感器捕捉到的原始数据转化为高质量输出的核心技术。然而&#xff0c;传统的ISP处理方法在…

螺丝、螺母、垫片等紧固件常用类型详细介绍

螺钉、螺母、垫片等紧固件介绍 螺钉 杯头内六角 首先介绍一下杯头内六角&#xff0c;杯头内六角是我们用的最常见的一种螺钉&#xff0c;如果你对选择螺钉没有什么想法&#xff0c;可以直接无脑选杯头内六角去使用。 比如说我们有一个零件加工了通孔&#xff0c;另一个零件加…

vmware,centos8(虚拟机) 的安装

安装vmware 点击下方网址 虚拟机安装地址https://www1.msc23.cn/vm/?bd_vid8829610582362807097选择VMware17 打开文件所在地&#xff0c;双击安装 同意条款 选择安装位置 不将VMware配置到环境变量path 不检查更新,不加入客户体验 创建桌面快捷方式 开始安装 安装完成…

CSP-J/S 考试介绍

CSP-J/S是由中国计算机学会&#xff08;CCF&#xff09;主办的非专业级别的软件能力认证考试。 CSP-J/S全称为CCF CSP-J/S&#xff0c;是CCF计算机软件能力认证&#xff08;简称CCFCSP认证&#xff09;中的一个部分&#xff0c;重点考察软件开发者实际编程能力。该项认证由CCF…

MTC完成右臂抓取放置任务\\放置姿态设置

#include "mtc_tutorial/mtc_glass_bottle.hpp" static const rclcpp::Logger LOGGER rclcpp::get_logger("mtc_glass_right"); // 获取节点基础接口的实现 rclcpp::node_interfaces::NodeBaseInterface::SharedPtr MTCTaskNode_Right::getNodeBaseInterf…

棋盘格角点检测-libcbdetect

libcbdetect libcbdetect 是一个用于自动子像素级别的棋盘格&#xff08;checkerboard&#xff09;、棋盘&#xff08;chessboard&#xff09;以及 Deltille 图案检测的库。它主要由 C 编写&#xff0c;旨在提供高精度、高鲁棒性的角点检测和图案组合功能&#xff0c;是一种基…

使用HTML和CSS制作网页的全面指南

目录 引言 一、理解HTML 1. 什么是HTML&#xff1f; 2. HTML文档的基本结构 3. 常用的HTML标签 4. 示例&#xff1a;创建一个简单的HTML页面 二、理解CSS 1. 什么是CSS&#xff1f; 2. CSS的使用方式 3. CSS选择器和属性 4. 常用的CSS属性 三、创建网页的步骤 1. 规…

【Java数据结构】二叉树

目录 树树的特征树的概念 二叉树两种特殊的二叉树二叉树的性质二叉树的基本操作4 种遍历二叉树的方式判断一棵树是不是完全二叉树获取二叉树总共的节点个数获取叶子节点的个数获取第 k 层的节点个数获取二叉树的高度检测值为 value 的元素是否存在 二叉树基本操作完整代码 树 …

VS code 安装使用配置 Continue

Continue 插件介绍 Continue 是一款高效的 VS Code 插件&#xff0c;提供类似 GitHub Copilot 的功能&#xff0c;旨在提升开发者的编程效率。其配置简单&#xff0c;使用体验流畅&#xff0c;深受开发者喜爱。 主要功能特点 智能代码补全 Continue 能够基于当前代码上下文生…

年化60.7%,最大回撤-16.5%,RSRS标准分择时效果差不多

原创内容第653篇&#xff0c;专注量化投资、个人成长与财富自由。 中秋节&#xff0c;祝大家中秋快乐&#xff01; 人有悲欢离合&#xff0c;月有阴晴圆缺&#xff0c;此事古难全。但愿人长久&#xff0c;千里共婵娟。 今天引入RSRS来择时&#xff0c;看下策略效果。 年化60.7…

Python编码系列—Python代理模式:为对象赋予超能力的魔法

&#x1f31f;&#x1f31f; 欢迎来到我的技术小筑&#xff0c;一个专为技术探索者打造的交流空间。在这里&#xff0c;我们不仅分享代码的智慧&#xff0c;还探讨技术的深度与广度。无论您是资深开发者还是技术新手&#xff0c;这里都有一片属于您的天空。让我们在知识的海洋中…

C++掉血迷宫

目录 开头程序程序的流程图程序游玩的效果下一篇博客要说的东西 开头 大家好&#xff0c;我叫这是我58。 程序 #include <iostream> #include <string> #include <cstring> using namespace std; enum RBYG {R 1,B 2,Y 4,G 7, }; struct heal {int ix…

【例题】lanqiao549 扫雷

输入 3 4 0 1 0 0 1 0 1 0 0 0 1 0输出 2 9 2 1 9 4 9 2 1 3 9 2解题思路 分类讨论&#xff1a; 如果原来的方格整数为1&#xff0c;输出9如果原来的方格整数为0&#xff0c;输出周围8个&#xff08;最多八个&#xff09;的地雷数量和 代码 如何遍历一个方格mp[i][j]周围…