C# 消除游戏

2023-10-27

就是练成3个或者以上就消除的游戏我用C# 没事写的, 可能有漏洞, 主要是练习C#的绘图
代码:

//Program.cs
using System;
using System.Windows.Forms;

namespace ColorRect
{
    /// <summary>
    /// Class with program entry point.
    /// </summary>
    internal sealed class Program
    {
        /// <summary>
        /// Program entry point.
        /// </summary>
        [STAThread]
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }

    }
}
//MainForm.cs
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.Windows.Forms;

namespace ColorRect
{
    /// <summary>
    /// Description of MainForm.
    /// </summary>
    public partial class MainForm : Form
    {
        private int i,j,width = 60,height = 60;
        private Graphics graph;
        private Rectangle[,] rects = new Rectangle[10,10];
        private SolidBrush[] brushes = new SolidBrush[7];
        private int[,] Map = new int[10,10];
        private Random ra = new Random();
        private int posx,posy,cha,chb;

        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }

        void 推出ToolStripMenuItemClick(object sender, EventArgs e)
        {
            this.Dispose(true);
        }

        void Rebuild(){
            for(i=0;i<8;i++)
                for(j=0;j<8;j++)
                    if(Map[i,j] == -1)
                        Map[i,j] = ra.Next(0,7);
        }

        void ReBuild2(){
            for(i=0;i<8;i++)
                for(j=0;j<8;j++)
                    if(Map[i,j] == -1){
                int tmp = ra.Next(0,7);
                while(tmp==Map[i+1,j]||tmp==Map[i,j+1])
                    tmp = ra.Next(0,7);
                Map[i,j] = tmp;
            }
        }

        void Init(object sender, EventArgs e){
            this.graph = this.CreateGraphics();
        }

        void Down(){
            int h, t;
            for(j = 0; j < 8; j++) {
                h = 7;
                for(i = 7; i >= 0; i--) {
                    t = Map[i,j];    Map[i,j] = 0;
                    if(t>-1)   Map[h--,j] = t;
                }
            }
        }

        void InitMap(){
            for(i=0;i<8;i++)
                for(j=0;j<8;j++)
                    Map[i,j] = Convert.ToInt32(ra.Next(0,7));
            RePaint();
            DrawFramework();
        }

        void DrawFramework(){
            Pen p = new Pen(Color.Black,5);
            graph.DrawLine(p,0,0,0,590);
            graph.DrawLine(p,60,0,60,590);
            graph.DrawLine(p,120,0,120,590);
            graph.DrawLine(p,180,0,180,590);
            graph.DrawLine(p,240,0,240,590);
            graph.DrawLine(p,300,0,300,590);
            graph.DrawLine(p,360,0,360,590);
            graph.DrawLine(p,420,0,420,590);
            graph.DrawLine(p,480,0,480,590);
            graph.DrawLine(p,0,25,590,25);
            graph.DrawLine(p,0,85,590,85);
            graph.DrawLine(p,0,145,590,145);
            graph.DrawLine(p,0,205,590,205);
            graph.DrawLine(p,0,265,590,265);
            graph.DrawLine(p,0,325,590,325);
            graph.DrawLine(p,0,385,590,385);
            graph.DrawLine(p,0,445,590,445);
            graph.DrawLine(p,0,505,590,505);
        }

        void FillRectangle(){
            for(i=0;i<8;i++)
                for(j=0;j<8;j++)
                        graph.FillRectangle(brushes[Map[i,j]],rects[i,j]);
        }

        void SwapColor(int x,int y,int x2,int y2){
            int tmp = Map[x,y];
            Map[x,y] = Map[x2,y2];
            Map[x2,y2] = tmp;
        }

        bool CheckDown(){
            bool[,] vis = new bool[10,10];
            int res = 0;
            for(i = 0; i < 8; i++)
                for(j = 0; j < 8; j++) {
                    if(j < 6) if( Map[i,j] > -1 && Map[i,j] == Map[i,j + 1] && Map[i,j + 1] == Map[i,j + 2])
                        vis[i,j] = vis[i,j + 1] = vis[i,j + 2] = true;
                    if(i < 6) if(Map[i,j] > -1 && Map[i,j] == Map[i + 1,j] && Map[i + 1,j] == Map[i + 2,j])
                        vis[i,j] = vis[i + 1,j] = vis[i + 2,j] = true;
                }
            for(i = 0; i < 8; i++)
                for(j = 0; j < 8; j++)
                    if(vis[i,j]){ Map[i,j] = -1; res++;}
            return res>0;
        }

        void DrawCheck(){
            if(cha!=-1){
                graph.FillRectangle(new SolidBrush(Color.Goldenrod),60*cha+15,60*chb+40,30,30);
            }
        }

        void DrawMouse(){
            graph.FillRectangle(new SolidBrush(Color.Purple),60*posx+15,60*posy+40,30,30);
        }

        void Checked(int x,int y){
            if(cha!=-1){
                if(x == cha&&(y-1==chb||y+1==chb)){
                    SwapColor(cha,chb,x,y);
                    if(CheckDown() == false)
                        SwapColor(cha,chb,x,y);
                    else{
                        RePaint();
                        cha = -1; chb = -1;
                    }
                }else if(y == chb&&(x+1==cha||x-1==cha)){
                    SwapColor(cha,chb,x,y);
                    if(CheckDown() == false)
                        SwapColor(cha,chb,x,y);
                    else{
                        RePaint();
                        cha = -1; chb = -1;
                    }
                }else{
                    cha = x; chb = y;
                }
            }else{
                cha = x;
                chb = y;
            }
        }

        void RePaint(){
            //InitMap();
            bool flag = true;
            do{
                Down();
                ReBuild2();
            }while(CheckDown()&&!flag);
            //graph.FillRectangle(new SolidBrush(Color.White),0,0,600,700);
            ReBuild2();
            FillRectangle();
            DrawFramework();
            DrawCheck();
            DrawMouse();
        }

        void IT(){
                for(i=0;i<8;i++)for(j=0;j<8;j++){rects[i,j] = new Rectangle(i*width,j*height+25,i*width+width,j*height+height+25);}
        }

        void 新游戏ToolStripMenuItemClick(object sender, EventArgs e)
        {
            Rectangle rect1 = new Rectangle(0,0,500,500);
            Brush col = new SolidBrush(Color.White);
            graph.FillRectangle(col,rect1);

            IT();

            brushes[0] = new SolidBrush(Color.White);
            brushes[1] = new SolidBrush(Color.Red);
            brushes[2] = new SolidBrush(Color.Blue);
            brushes[3] = new SolidBrush(Color.Gray);
            brushes[4] = new SolidBrush(Color.Yellow);
            brushes[5] = new SolidBrush(Color.Green);
            brushes[6] = new SolidBrush(Color.Pink);

            InitMap();

            if(CheckDown()){
                Down();
                ReBuild2();
            }

            FillRectangle();
            DrawFramework();

            posx = 0; posy = 0;
            cha = -1; chb = -1;
            DrawMouse();
        }

        void KeyUpListener(object sender,KeyEventArgs e){
            string key = e.KeyCode.ToString();
            if(key == "Up"){
                if(posy > 0)
                    posy--;
            }
            else if(key == "Down"){
                if(posy < 7)
                    posy++;
            }
            else if(key == "Right"){
                if(posx < 7)
                    posx++;
            }
            else if(key == "Left"){
                if(posx>0)
                    posx--;
            }
            else if(key == "Space"){
                Checked(posx,posy);
            }
            RePaint();
        }
    }
}
//MainForm.Designer
namespace ColorRect
{
    partial class MainForm
    {
        /// <summary>
        /// Designer variable used to keep track of non-visual components.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Disposes resources used by the form.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing) {
                if (components != null) {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        /// <summary>
        /// This method is required for Windows Forms designer support.
        /// Do not change the method contents inside the source code editor. The Forms designer might
        /// not be able to load this method if it was changed manually.
        /// </summary>
        private void InitializeComponent()
        {
            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.游戏ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.新游戏ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.推出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.帮助ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.帮助ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.关于ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
            this.statusStrip1.SuspendLayout();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // statusStrip1
            //
            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                                    this.toolStripStatusLabel1});
            this.statusStrip1.Location = new System.Drawing.Point(0, 505);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new System.Drawing.Size(481, 22);
            this.statusStrip1.TabIndex = 0;
            this.statusStrip1.Text = "statusStrip1";
            //
            // menuStrip1
            //
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                                    this.游戏ToolStripMenuItem,
                                    this.帮助ToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(481, 25);
            this.menuStrip1.TabIndex = 1;
            this.menuStrip1.Text = "menuStrip1";
            //
            // 游戏ToolStripMenuItem
            //
            this.游戏ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                                    this.新游戏ToolStripMenuItem,
                                    this.推出ToolStripMenuItem});
            this.游戏ToolStripMenuItem.Name = "游戏ToolStripMenuItem";
            this.游戏ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
            this.游戏ToolStripMenuItem.Text = "游戏";
            //
            // 新游戏ToolStripMenuItem
            //
            this.新游戏ToolStripMenuItem.Name = "新游戏ToolStripMenuItem";
            this.新游戏ToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
            this.新游戏ToolStripMenuItem.Text = "新游戏";
            this.新游戏ToolStripMenuItem.Click += new System.EventHandler(this.新游戏ToolStripMenuItemClick);
            //
            // 推出ToolStripMenuItem
            //
            this.推出ToolStripMenuItem.Name = "推出ToolStripMenuItem";
            this.推出ToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
            this.推出ToolStripMenuItem.Text = "退出";
            this.推出ToolStripMenuItem.Click += new System.EventHandler(this.推出ToolStripMenuItemClick);
            //
            // 帮助ToolStripMenuItem
            //
            this.帮助ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                                    this.帮助ToolStripMenuItem1,
                                    this.关于ToolStripMenuItem});
            this.帮助ToolStripMenuItem.Name = "帮助ToolStripMenuItem";
            this.帮助ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
            this.帮助ToolStripMenuItem.Text = "帮助";
            //
            // 帮助ToolStripMenuItem1
            //
            this.帮助ToolStripMenuItem1.Name = "帮助ToolStripMenuItem1";
            this.帮助ToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
            this.帮助ToolStripMenuItem1.Text = "帮助";
            //
            // 关于ToolStripMenuItem
            //
            this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
            this.关于ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.关于ToolStripMenuItem.Text = "关于";
            //
            // toolStripStatusLabel1
            //
            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
            this.toolStripStatusLabel1.Size = new System.Drawing.Size(131, 17);
            this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
            //
            // MainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(481, 527);
            this.Controls.Add(this.statusStrip1);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "MainForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "ColorRect";
            this.Shown += new System.EventHandler(this.Init);
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem 帮助ToolStripMenuItem1;
        private System.Windows.Forms.ToolStripMenuItem 帮助ToolStripMenuItem;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
        private System.Windows.Forms.ToolStripMenuItem 推出ToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem 新游戏ToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem 游戏ToolStripMenuItem;
        private System.Windows.Forms.MenuStrip menuStrip1;
        private
//MainForm.resx
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema

    Version 2.0

    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.

    Example:

    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>

    There are any number of "resheader" rows that contain simple
    name/value pairs.

    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.

    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:

    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.

    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>17, 17</value>
  </metadata>
  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>143, 17</value>
  </metadata>
</root>
//ColorRect.csproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
  <PropertyGroup>
    <ProjectGuid>{DE63FB41-2BB2-4F04-B676-3D5B90D75344}</ProjectGuid>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <OutputType>WinExe</OutputType>
    <RootNamespace>ColorRect</RootNamespace>
    <AssemblyName>ColorRect</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    <AppDesignerFolder>Properties</AppDesignerFolder>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <OutputPath>bin\Debug\</OutputPath>
    <DebugSymbols>True</DebugSymbols>
    <DebugType>Full</DebugType>
    <Optimize>False</Optimize>
    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <OutputPath>bin\Release\</OutputPath>
    <DebugSymbols>False</DebugSymbols>
    <DebugType>None</DebugType>
    <Optimize>True</Optimize>
    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
    <DefineConstants>TRACE</DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data" />
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="MainForm.cs" />
    <Compile Include="MainForm.Designer.cs">
      <DependentUpon>MainForm.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="MainForm.resx">
      <DependentUpon>MainForm.cs</DependentUpon>
    </EmbeddedResource>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

转载于:https://www.cnblogs.com/JeremyGJY/p/5921748.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

C# 消除游戏 的相关文章

随机推荐

  • MarkDown创建表格

    凑微分方法 1 csc 2 xdx d cotx 2 secxtanxdx d secx 3 cscxcotxdx d cscx 4 dfrac 1 1 x 2 dx d arctanx d arccotx 5 dfrac 1 sqrt 1
  • el-table动态添加行,列。自定义输入表头,input hover 显示文字

    功能点 1 动态添加行 2 动态添加列 3 右键表头删除列 4 右键表体删除行 5 表格hover提示当前单元格文字 自动换行 6 表头文字自定义 7 表头 添加按钮固定 表体自适应滚动 效果图 代码 复制即可运行
  • web前端开发学习路径图

    第一阶段 WEB前端工程师课程 HTML语句 HTML页面结构 css语法 style属性 link和style标签 id属性 等HTML语句中的相关属性 通过Dreamweaver制作出跨越平台限制和跨越浏览器兼容性的页面 掌握Dream
  • 记录一次脱壳后修复apk

    前言 好不容易会脱壳 但是却仅仅只能得到dex文件 无法动态调试apk 这样还是不行 因此我们需要对源apk进行修复 准备 首先我这里是脱了一个爱加密的壳得到dump dex使用jadx gui可以正常打开 说明脱壳成功了 接下来就是将du
  • Python 日志 TimedRotatingFileHandler

    Python日志TimedRotatingFileHandler通常不是我们需求的 所以进行了一些重写 class MyTimedRotatingFileHandler TimedRotatingFileHandler 时间为切割点日志 d
  • TensorRT加速方法介绍(python pytorch模型)

    TensorRT的安装可见我的上一篇博客 Ubuntu配置TensorRT及验证 jiugeshao的专栏 CSDN博客博主的一些基本环境配置可见之前博客非虚拟机环境下Ubuntu配置 jiugeshao的专栏 CSDN博客第一步 准备安装
  • Java简易图书管理系统开发全过程 (2)

    今天我们继续来开发这个项目 Java简易图书管理系统开发全过程 2 代码层级规划 正式开干 代码层级规划 根据代码的功能 我们需要提前把代码的包等结构确定下来 由于这个项目是小型的 所以可以分为以下几部分 前端窗体 后端逻辑 全局变量存放类
  • 对雷达中相位补偿概念的一些理解

    以两个问题为例展开 分别是基于多普勒相位补偿的速度扩展方法 记为问题1 和DBF测角 记为问题2 两者本质上都是对相位进行补偿 为什么这么说呢 听我细细到来 如图 问题1的关键就是要去补偿掉TX2对应的接收天线RX5 RX8中的delta
  • window.showModalDialog以及window.open用法简介

    windows open 用法简介一 window open 支持环境 JavaScript1 0 JScript1 0 Nav2 IE3 Opera3 二 基本语法 window open pageURL name parameters
  • Mina基础(七):Mina整合Spring服务端、Spring boot 客户端

    Mina基础 一 基本结构分析 长短连接 IOService Mina基础 二 基础服务端 客户端搭建 Mina基础 三 IOFilter 自定义过滤器 日志过滤器 Mina基础 四 理解IoSession I O Processor Io
  • MATLAB中出现 索引超出矩阵维度,程序用matlab运行显示索引超出矩阵维度,请问怎么...

    公告 为响应国家净网行动 部分内容已经删除 感谢读者理解 话题 程序用matlab运行显示索引超出矩阵维度 请问怎么改 回答 用size函数可以求矩阵维数 用reshape可以改变数据维数 如 a 1 2 3 4 5 6 7 8 9 siz
  • 数据库模糊搜索时,关键字中有%号,怎么办?

    数据库模糊搜索时 关键字中有 号 怎么办 数据库模糊搜索时 都知道应该用通配符 号来模糊匹配 如 select from table where content like key 但当关键字key中也包含有 号时 应该怎么办 数据库中有关键
  • SpringBoot日志框架管理

    目录 一 SpringBoot日志框架的介绍 二 使用SpringBoot日志的好处 三 SpringBoot日志框架的使用 1 日志门面 日志的抽象层 2 日志实现 3 SpringBoot日志框架的引入 4 日志的格式 5 日志持久化
  • 生成项目结构图

    1 展示 D gitcode com spring pro test controller gt tree 文件夹 PATH 列表 卷序列号为 3289 54FC D settings src main java com cloud con
  • VScode在远程服务器进行python代码的调试【conda环境】

    conda环境 vscode连接远程环境 调试 vscode连接远程环境 其中vscode中需要安装扩展 remote ssh 装完扩展后本地多个图标 如下图所示 当然 初始状态不是这样 因为我已经配置好了哈 你需要点击 然后在框框中输入用
  • bootstrap-wizard插件

    bootstrap wizard的帮助文档 http vinceg github io twitter bootstrap wizard bootstrap wizard的GitHub地址 https github com gillumin
  • 一起学Redis(2)——链表、哈希表

    链表 废话不多说 今天继续学习Redis的基本数据结构 链表和哈希表 先看一个例子 以下展示的integers列表键包含了从1到1024共一千零二十四个整数 redis gt LLEN integers integer 1024 redis
  • 前端模糊匹配方式,前端正则模糊匹配

    前端的匹配方式有很多这里简单提供模糊匹配方式 使用 RegExp 函数 正则表达式来进行匹配 正则表达式 var list nai 43q 5xn var keyWord n var arr var reg new RegExp keyWo
  • 贪心算法的数学证明 (更新中)

    目录 1 贪心算法 2 贪心算法的证明方式 1 替换法 反证法 2 数学归纳法 递推法 1 贪心算法 定义 对于解决问题的每一个步骤 总选择当前步骤的局部最优解 希望以此达到总体最优 性质 贪心算法与搜索 动态规划一脉相承 但贪心算法并不遍
  • C# 消除游戏

    就是练成3个或者以上就消除的游戏我用C 没事写的 可能有漏洞 主要是练习C 的绘图 代码 Program cs using System using System Windows Forms namespace ColorRect