• JavaScript graphic example: Hilbert curve


    In 1891, German mathematician David Hilbert constructed a kind of curve. First, he divided a square into four small squares, starting from the center of the square in the northwest corner, going south to the center of the square in the southwest, then east to the center of the square in the southeast corner, and […]

  • Analysis of Python example of spark


    Here is an analysis of Spark’s own example of PI, as the entry codeFirst of all, let’s introduce the principle of PIIn fact, it is also a Monte Carlo simulation algorithm. The basic method is to consider a square with side length of 1If you draw a circle with a point of the square as […]

  • Colorpicker of mobile terminal made by canvas


    Color picker of mobile terminal made by canvas I’m in another roomdemoI need to use the color picker in Android, but I can’t find the color picker I need on the mobile terminal. Many of them are PC’s, and then I find that the input [type =’color ‘] exists. I find that Android is OK, […]

  • Learning canvas from a Sketchpad demo


    preface I started to learn canvas and made a Sketchpad application,The address is here. This article is some basic ideas and considerations of canvas, not basic API. It mainly lies in the practical experience of touch event Retina screen compatible Retina screen will use multiple physical pixels to render an independent pixel, resulting in double […]

  • Spark 3. Spark programming mode


    Write on the front This series is a combination of my understanding records in the process of learning spark + some understanding of reference articles + some personal experience in the process of practicing spark. Writing such a series is just to sort out the notes of personal learning spark, so everything is mainly to […]

  • JavaScript graphic example: plane mosaic pattern


    Mosaic with one or several plane figures of the same shape and size, and lay them together without any gap or overlap, is called plane mosaic of these figures. 1. A planar mosaic pattern realized by a polygon We can use regular triangle, square or regular hexagon to realize plane mosaic. (1) Tile with a […]

  • C practical exercise topic 9


    Title:Request to output chess board. Program analysis:The chess board consists of 64 black and white squares, which are divided into 8 rows * 8 columns. I controls the row, J controls the column, and controls the output black or white squares according to the change of the sum of I + J. In case of […]

  • C practical exercise topic 10


    Title:Print the stairs and print two smiley faces above the stairs at the same time. Program analysis:Use ASCII 1 to output smiley face; I to control the row, j to control the column, j to control the number of black squares according to the change of I. In case of garbled code, please refer to […]

  • How to implement the best algorithm of small game 2048? Full analysis of ideas!


    1. Introduction A lot of people have played 2048, so I’m old-fashioned, because I always don’t like this kind of stand-alone games. But on one day, I took my daughter-in-law’s mobile phone, looked left and right, and somehow opened 2048. Well, it’s really a good game to kill the boring time. By sliding to make […]

  • Maximum square dynamic programming method


    In a two-dimensional matrix consisting of 0 and 1, find the largest square containing only 1 and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Output: 4 Dynamic programming method analysis We use DP (I, J) DP (I, […]

  • leetcode473. Matchsticks to Square


    Title Requirements Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchsticks. You should not break any stick, but you can link them up, and each matchstick must be used […]

  • Drawing method of C ා square picture


    The example of this paper shares the specific code of drawing square picture with C ා for your reference. The specific content is as follows using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Linq; using System.Text; using System.Threading.Tasks; namespace treads { /// <summary> ///Making small squares /// </summary> class Class3 { Private […]