当前位置:网站首页>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.git
Installing
Configure environment variables ( My computer -> attribute -> Advanced environment variables -> environment variable -> New system variable )
stay path Add
%gop%\bin
, In the middle of thegop
Is 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)
}
边栏推荐
- Lex & yacc & bison & flex configuration problems
- 【AutoSAR 二 AppL概述】
- 1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
- Merge K sorted linked lists
- Data analysis, thinking, law breaking and professional knowledge -- analysis method (I)
- In the first half of 2022, there are 10 worth seeing, and each sentence can bring you strength!
- 研发一款国产ARM智能边缘计算网关需要什么
- [daily training] 871 Minimum refueling times
- Lu Zhe, chief scientist of Shiping information: building data and personnel centered security capabilities
- 链表内指定区间反转
猜你喜欢
测试右移:线上质量监控 ELK 实战
[case sharing] let the development of education in the new era advance with "number"
How to convert Quanzhi a40i/t3 to can through SPI
[AUTOSAR + IO Architecture]
What is needed to develop a domestic arm intelligent edge computing gateway
Illustrated network: what is virtual router redundancy protocol VRRP?
[AUTOSAR five methodology]
1.11 - bus
【AutoSAR 三 RTE概述】
2022 list of manufacturers of Chinese 3D vision enterprises (guided positioning and sorting scenes)
随机推荐
MySQL multi table joint deletion
[AUTOSAR + IO Architecture]
(C language) data storage
Several cases of recursive processing organization
lex && yacc && bison && flex 配置的問題
[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
[AUTOSAR nine c/s principle Architecture]
[AUTOSAR VI description document]
matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决
Vulkan is not a "panacea"“
1696C. Fishingprince Plays With Array【思维题 + 中间状态 + 优化存储】
What is needed to develop a domestic arm intelligent edge computing gateway
有向图的强连通分量
瑞萨RZ/G2L ARM开发板存储读写速度与网络实测
1.11 - bus
Linear programming of mathematical modeling (including Matlab code)
12_ Implementation of rolling automatic video playback effect of wechat video number of wechat applet
数组与集合性能比较
leetcode-1964:找出到每个位置为止最长的有效障碍赛跑路线
Lu Zhe, chief scientist of Shiping information: building data and personnel centered security capabilities