当前位置:网站首页>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)
}
边栏推荐
- Reading and writing speed of Reza rz/g2l arm development board storage and network measurement
- excel IF公式判断两列是否相同
- JS inheritance and prototype chain
- 2022 list of manufacturers of Chinese 3D vision enterprises (guided positioning and sorting scenes)
- 全志A40i/T3如何通过SPI转CAN
- 研发一款国产ARM智能边缘计算网关需要什么
- (C语言)数据的存储
- [love crash] neglected details of gibaro
- mysql 多表联合删除
- leetcode-241:为运算表达式设计优先级
猜你喜欢

【AutoSAR 一 概述】

The arm core board / development board of Feiling equipped with Ti am62x made its debut in embedded world 2022

【爱死机】《吉巴罗》被忽略的细节

How to convert Quanzhi a40i/t3 to can through SPI

安全运营四要素之资产、脆弱性、威胁和事件

Rk3568 development board evaluation (II): development environment construction

Lu Zhe, chief scientist of Shiping information: building data and personnel centered security capabilities
![[AUTOSAR I overview]](/img/e4/b97c6beebf6f431d2d7cf209c6683e.png)
[AUTOSAR I overview]

寻找标杆战友 | 百万级实时数据平台,终身免费使用

用Go+绘制爱心给心爱的她表白
随机推荐
Explain the basic concepts and five attributes of RDD in detail
Array and collection performance comparison
[AUTOSAR eight OS]
链表中的节点每k个一组翻转
飞凌搭载TI AM62x的ARM核心板/开发板首发上市,亮相Embedded World 2022
1696C. Fishingprince plays with array [thinking questions + intermediate state + optimized storage]
Leetcode-871: minimum refueling times
FPGA - 7 Series FPGA internal structure clocking -04- multi area clock
Initial order of pointer (basic)
Inversion de l'intervalle spécifié dans la liste des liens
无向图的割点
ROS2之ESP32简单速度消息测试(极限频率)
Leetcode-2280: represents the minimum number of line segments of a line graph
JS inheritance and prototype chain
【案例分享】让新时代教育发展与“数”俱进
Problèmes de configuration lex & yacc & Bison & Flex
Infrared thermography temperature detection system based on arm rk3568
[daily training] 871 Minimum refueling times
数组与集合性能比较
[AUTOSAR twelve mode management]