- Go Systems Programming
- Mihalis Tsoukalos
- 248字
- 2021-07-02 18:08:00
Exercises
- Browse the Go documentation site: https://golang.org/doc/.
- Write a Go program that keeps reading integers until you give the number 0 as input, then it prints the minimum and maximum integer in the input.
- Write the same Go program as before, but this time, you will get your input using command-line arguments. Which version do you think is better? Why?
- Write a Go program that supports two command-line options (-i and -k) in random order using if statements. Now change your program to support three command-line arguments. As you will see, the complexity of the latter program is just too much to handle using if statements.
- If the indices of a map were natural numbers, are there any cases that it would be wise and efficient to use a map instead of an array?
- Try to put the functionality of array2map.go into a separate function.
- Try to develop your own random number generator in Go that will still use the current time as a seed but not the math/rand package.
- Learn how to create a slice from an existing array. What happens when you make changes to the slice?
- Use the copy() function to make a copy of an existing slice. What happens when the destination slice is smaller than the source slice? What happens when the destination slice is bigger than the source slice?
- Try to write an interface for supporting points in 3D space. Then, use this interface to support points that reside on the x-axis.
推薦閱讀
- 微服務設計(第2版)
- C語言程序設計(第3版)
- Learn to Create WordPress Themes by Building 5 Projects
- 騰訊iOS測試實踐
- Learning AndEngine
- 網站構建技術
- UML 基礎與 Rose 建模案例(第3版)
- Instant Ext.NET Application Development
- Node.js:來一打 C++ 擴展
- Python深度學習原理、算法與案例
- App Inventor創意趣味編程進階
- Python 3 數據分析與機器學習實戰
- Android智能手機APP界面設計實戰教程
- Monitoring Docker
- Scratch編程從入門到精通