当前位置:网站首页>Draw love with go+ to express love to her beloved
Draw love with go+ to express love to her beloved
2022-07-03 01:07:00 【No envy】
Catalog
To achieve the effect of

️Go+ Language introduction
Go+ stay 2020 year 7 When the moon first came out , Its slogan yes
“ Born for Data Science ”. And in the Go+1.0 When the version took the first step of commercialization ,slogan Become a trinity “for engineering, STEM education, and data science”.
“for engineering” Committed to making it possible for engineers to use simple 、 Easy to master language to work , This is a very important evolution in the complex field of engineering technology .
“for STEM education” It is hoped that teenagers can learn an engineering language from primary school , In order to continue to use in future work . at present , The first programming language children come into contact with is usually Scratch, It's hard to be useful for life .
“for data science” So that engineers and data scientists can talk in the same language , This is particularly important in the future of data-driven innovation .
go+ Language features
Go+ A very interesting point , It is The only language with dual engines , Static compilation is supported , Resolvable execution is also supported .
Why do we have to do double engines ? Because I think the demands of programmers and data scientists are different , Data scientists like to go one step , You can recall in your mind the mathematical software you have seen , Include SAS、MATLAB, Mathematical software interaction is a one-step way .
This is not because data scientists are lazy . It's in the programmer's head to understand program logic , We know in our mind whether the program logic is written correctly . But when data scientists do calculations , I don't know if the result is right , Because people's computing power is much weaker than computers , therefore Be sure to step by step to see the calculation results , To know what to do next , This is a point where data scientists and programmers work in a completely different way .
Because he's doing calculations, not programming logic , So it's hard for him not to do step-by-step execution .
But when data scientists build a model , It's going to be used in the end , At this time, he still wants to maximize the efficiency of execution , He must not want the code to run slowly , So at this time, he needs to compile and execute statically , That's why Go+ I want to design it as a twin engine , Because the debugging phase and production use phase , The working mode is completely different .
Go+ Environment building
install Git Tools
Git Official website address :https://git-scm.com/download/win
Choose the version ( My computer is 32 position ):


Choose the path :

After installation , stay cmd Console access :
git version, The version number displayed indicates that the installation was successful .
install Go+
official GitHub Address :https://github.com/goplus/gop
We use Git Tool download and install Go+, stay cmd Console access :
git clone https://github.com/goplus/gop.gitInstalling

Configure environment variables ( My computer -> attribute -> Advanced environment variables -> environment variable -> New system variable )
stay path Add %gop%\bin, In the middle of thegopIs the variable name we used earlier .
Drawing love
The environment is set up , Next, create a .txt The file of , After copying the code , Change the suffix to .gop
package main
import (
"flag"
"fmt"
"math"
"strings"
"time"
)
func main() {
// MYWORD My word
var head string
var tail string
var MYWORD string
var sep string
var zoom float64
flag.StringVar(&head, "head", "There are some words I wana tell you:", "A sentence printed on the head") // Add the words to be written at the beginning
flag.StringVar(&tail, "tail", "\t\t\t\t--- Your lover", "A sentence printed on the tail") // Add words to the end
flag.StringVar(&MYWORD, "words", "Dear, I love you forever!", "The words you want to talk") // The content of love
flag.StringVar(&sep, "sep", " ", "The separator")
flag.Float64Var(&zoom, "zoom", 1.0, "Zoom setting")
flag.Parse()
chars := strings.Split(MYWORD, sep)
time.Sleep(time.Duration(1) * time.Second)
fmt.Println(head)
fmt.Println()
time.Sleep(time.Duration(1) * time.Second)
for _, char := range chars {
allChar := make([]string, 0)
for y := 12 * zoom; y > -12*zoom; y-- {
lst := make([]string, 0)
lstCon := ""
for x := -30 * zoom; x < 30*zoom; x++ {
x2 := float64(x)
y2 := float64(y)
formula := math.Pow(math.Pow(x2*0.04/zoom, 2)+math.Pow(y2*0.1/zoom, 2)-1, 3) - math.Pow(x2*0.04/zoom, 2)*math.Pow(y2*0.1/zoom, 3)
if formula <= 0 {
index := int(x) % len(char)
if index >= 0 {
lstCon += string(char[index])
} else {
lstCon += string(char[int(float64(len(char))-math.Abs(float64(index)))])
}
} else {
lstCon += " "
}
}
lst = append(lst, lstCon)
allChar = append(allChar, lst...)
}
for _, text := range allChar {
fmt.Printf("%s\n", text)
}
}
time.Sleep(time.Duration(1) * time.Second)
fmt.Println("\t\t\t\t", tail)
}
边栏推荐
- [shutter] image component (cached_network_image network image caching plug-in)
- 链表中的节点每k个一组翻转
- 有向图的强连通分量
- [AUTOSAR twelve mode management]
- R language uses coin package to apply permutation tests to independence problems (permutation tests, whether response variables are independent of groups, are two numerical variables independent, and
- 465. 最优账单平衡 DFS 回溯
- The difference between tail -f, tail -f and tail
- excel表格计算时间日期的差值,并转化为分钟数
- Basic use of sringcloud & use of component Nacos
- 12_ Implementation of rolling automatic video playback effect of wechat video number of wechat applet
猜你喜欢

【AutoSAR 四 BSW概述】

How to systematically learn machine learning
![leetcode:871. Minimum refueling times [Pat has done before + maximum stacking + greed]](/img/2c/8ec3926243fac8db9ed45d8053f3af.png)
leetcode:871. Minimum refueling times [Pat has done before + maximum stacking + greed]
![1696C. Fishingprince plays with array [thinking questions + intermediate state + optimized storage]](/img/bf/ab6838e34a3074130eac0a9992e77c.png)
1696C. Fishingprince plays with array [thinking questions + intermediate state + optimized storage]

RK3568开发板评测篇(二):开发环境搭建

信息熵的基础

Asynchronous, email and scheduled tasks

RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide

Trois tâches principales: asynchrone, courrier et timing
![[AUTOSAR nine c/s principle Architecture]](/img/59/ce32c0ff58ef5d8385fe950136175b.png)
[AUTOSAR nine c/s principle Architecture]
随机推荐
【AutoSAR 一 概述】
1.11 - bus
JS inheritance and prototype chain
Leetcode-849: maximum distance to the nearest person
递归处理组织的几种情况
The R language uses the ctree function in the party package to build conditional inference decision trees, uses the plot function to visualize the trained conditional inference decision tree, and the
Inversion de l'intervalle spécifié dans la liste des liens
机器学习术语
Leetcode-2115: find all the dishes that can be made from the given raw materials
[AUTOSAR XIII NVM]
Machine learning: numpy version linear regression predicts Boston house prices
[AUTOSAR five methodology]
Leetcode-224: basic calculator
Leetcode-871: minimum refueling times
[love crash] neglected details of gibaro
Leetcode-2280: represents the minimum number of line segments of a line graph
The difference between tail -f, tail -f and tail
leetcode-849:到最近的人的最大距离
[overview of AUTOSAR three RTE]
leetcode-871:最低加油次数