当前位置: 首页 > news >正文

bootstrap公司网站模板网络营销外包推广定制公司

bootstrap公司网站模板,网络营销外包推广定制公司,3d房屋建筑设计软件,深圳专业网站排名公司今天的主菜是土豆,就来个土豆丝吧。我的大致流程如下: 1.挑选白瓤土豆,洗它 2.土豆去皮 3.土豆切片,切丝,丝要粗细均匀 4.清洗几遍土豆丝,去除上面的淀粉,在清水中泡一小会 5.起锅,放…

今天的主菜是土豆,就来个土豆丝吧。我的大致流程如下:
1.挑选白瓤土豆,洗它
2.土豆去皮
3.土豆切片,切丝,丝要粗细均匀
4.清洗几遍土豆丝,去除上面的淀粉,在清水中泡一小会
5.起锅,放适量水,烧开[适量实在是太抽象了]
6.备好葱花、姜丝、蒜、青/红辣椒丝
7.放入土豆丝,焯致八九分熟,或者看到土豆丝表面晶莹剔透,即可捞出放入凉水中
8.起锅,放油,放花椒、姜丝、辣椒丝
9.放入土豆丝快速翻炒
10.放入适量盐,蒜沫,翻炒一下
11.放入适量醋,再翻炒一下
12.出锅盛盘
13.撒上些葱花,开吃

package mainimport ("fmt""math/rand""time"
)// 定义常量,默认清洗时间
const default_wash_second int = 1// 常量,土豆瓤的颜色
const (white  = "WHITE"yellow = "YELLOW"
)/******************************************************************************** 挑选土豆* color 土豆瓤的颜色******************************************************************************/
func select_potato(color string) {fmt.Println("使用的是 [", color, "] 土豆")
}/******************************************************************************** 清洗土豆* sec 清洗时间,单位秒******************************************************************************/
func wash_potato(sec uint) {fmt.Println("正在清洗土豆")time.Sleep(time.Duration(sec) * time.Second)fmt.Println("清洗完毕")
}/******************************************************************************** 去除土豆表皮* sec 清洗时间,单位秒******************************************************************************/
func peel_potato(sec uint) {fmt.Println("正在去除土豆表皮,只是表皮,去除多了会浪费土豆")time.Sleep(time.Duration(sec) * time.Second)fmt.Println("去除土豆表皮完毕")
}/******************************************************************************** 将土豆切丝,土豆丝不是越细越好,而是要粗细均匀,宽厚一致,截面为正方形,* 土豆丝可以轻易捻动* width 土豆丝的宽度及厚度* sec 清洗时间,单位秒******************************************************************************/
func shred_the_potato(width, sec uint) {fmt.Println("正在将土豆切成 [", width, "] mm 厚的薄片")time.Sleep(time.Duration(sec) * time.Second)fmt.Println("切片完成,准备切丝")fmt.Println("正在将土豆片切成 [", width, "] mm 厚的土豆丝")time.Sleep(time.Duration(sec) * time.Second)fmt.Println("土豆丝已切好")
}/******************************************************************************** 清洗土豆丝,清洗的目的是去除其表面的淀粉,这样炒出的土豆丝口感脆爽* 洗致水依然清澈,则可以不再清洗了,times并不是判断是否清洗好的标准* times 清洗次数******************************************************************************/
func wash_potato_shreds(times uint) {var i uint = 0for i < times {fmt.Printf("第[%d]遍清洗\n", i+1)time.Sleep(time.Duration(default_wash_second) * time.Second)i++}fmt.Println("土豆丝已清洗好,浸泡片刻,这水好清澈啊......")
}/******************************************************************************** 取出土豆丝,准备使用******************************************************************************/
func get_potato_shreds() {fmt.Println("沥干水分,取出土豆丝")
}/******************************************************************************** 烧水,准备焯土豆丝用******************************************************************************/
func heat_up_water() {fmt.Println("起锅,放入适量水,直到烧开")
}/******************************************************************************** 趁烧水的空档,准备辅料******************************************************************************/
func prepare_others() {fmt.Println("趁烧水的时间,准备辅料")time.Sleep(time.Duration(default_wash_second) * time.Second)fmt.Println("姜切丝、青红辣椒切丝")time.Sleep(time.Duration(default_wash_second) * time.Second)fmt.Println("切葱花、剁蒜沫")time.Sleep(time.Duration(default_wash_second) * time.Second)fmt.Println("辅料已备好")
}/******************************************************************************** 焯土豆丝******************************************************************************/
func blanch_potato_shreds() {get_potato_shreds()fmt.Println("将土豆丝放入开水中,焯致八分熟\n捞出土豆丝放入凉水中备用")time.Sleep(time.Duration(default_wash_second) * time.Second)
}/******************************************************************************** 炒土豆丝喽******************************************************************************/
func fry_potato_shreds() {fmt.Println("起锅,加入适量油,待油热,加入花椒、姜丝、辣椒丝,煸炒一下")time.Sleep(time.Duration(default_wash_second<<1) * time.Second)get_potato_shreds()fmt.Println("将土豆丝放入锅中,快速翻炒")time.Sleep(time.Duration(default_wash_second<<2) * time.Second)fmt.Println("加入蒜沫、适量盐,翻炒一下")time.Sleep(time.Duration(default_wash_second<<1) * time.Second)fmt.Println("加入适量醋,翻炒一下")time.Sleep(time.Duration(default_wash_second) * time.Second)if 0 == get_rand_number() {fmt.Println("出锅盛盘,撒上些葱花,开始享用啦")} else {fmt.Println("没控制好火候,炒糊啦!吃还是不吃,这是个问题啊")}time.Sleep(time.Duration(default_wash_second<<2) * time.Second)
}/******************************************************************************** 获取炒制成功或失败的标志******************************************************************************/
func get_rand_number() int {my_rand := rand.New(rand.NewSource(time.Now().UnixNano()))return my_rand.Int() % 2
}/******************************************************************************** 炒好菜即刷锅,还是吃过菜后刷,好纠结啊******************************************************************************/
func clear() {fmt.Println("不要忘记刷锅 -*-_-*-")
}/******************************************************************************** 制作流程******************************************************************************/
func cook() {var sec uint = 1var width, times = uint(3), uint(4)select_potato(white)wash_potato(sec)peel_potato(sec)shred_the_potato(3, sec)wash_potato_shreds(4)heat_up_water()prepare_others()blanch_potato_shreds()fry_potato_shreds()clear()
}/******************************************************************************** guess what******************************************************************************/
func main() {cook()
}

烹饪这道菜,我至少学会了如何使用 go 的标识符,变量、常量、注释、运算符及函数等。接下来做个总结:
[]:很大部分来自官网,感兴趣的可以去逛逛。
通过前面hello world那篇简单的入门,我们知道第一行中的 package 是用来定义包的。

注释

注释主要起说明作用。好的注释可以方便别人及自己理解程序。
go 的注释有两种,分别为 Line comments(//) 和 General comments(/* */)

注释描述
Line comment// 开始到当前行结束
General comment/* 开始,到第一个 */ 结束

可以看到,go 与 C(C99)/C++ 中的注释风格是一致的。

示例

	// 这是一个Line comment/* 这是一个general comment,但是这个注释与行注释的表现是一样的 *//* 这也是一个general comment,它的表现就和行注释不一样了 */

标识符

标识符,用来给程序中的实体命名。比如对变量,函数,结构体等命名,说白了就是给不同类型的变量起个唯一能标识它们的名字,仅此而已。
go 中合法的标识符,由一到多个字母、数字、下划线组成,且首字母不能为数字。注意,这里的字母是Unicode字母,即汉字可以作为变量名,但最好还是使用英文字符。

除了 go 使用 Unicode 字符作为标识符外,其他规则与 C/C++ 是一致的。

关键字

说到标识符,就不能不提关键字,关键字是 go 预先定义好的标识符,我们只能使用它们,而不能将它们用作自己的标识符。

breakdefaultfuncinterfaceselect
casedefergomapstruct
chanelsegotopackageswitch
constfallthroughifrangetype
continueforimportreturnvar

结合着C/C++,Java,Python等,也就只有几个别的关键字没见过了,对 go 的恐惧一下子就减少了很多。

除了上面的 25 个关键字外,go 还预字义了以下的标识符,它们是全局的,仔细看一下,是不是很多也不陌生。
Types:(21个)

boolbytecomplex64complex128errorfloat32float64
intint8int16int32int64runestring
uintuint8uint16uint32uint64uintptr

Constants:(3个)

truefalseiota

Zero value:(只此一个)

nil

Functions:(15个)

appendcapclosecomplexcopydeleteimaglen
makenewpanicprintprintlnrealrecover

感觉有些多且乱?没关系,多见几次就熟悉它们了。


文章转载自:
http://soupfin.rjbb.cn
http://holyday.rjbb.cn
http://infallibly.rjbb.cn
http://intervital.rjbb.cn
http://premature.rjbb.cn
http://scorpion.rjbb.cn
http://morphogeny.rjbb.cn
http://bootblack.rjbb.cn
http://demarcation.rjbb.cn
http://stumper.rjbb.cn
http://rhythmed.rjbb.cn
http://sonless.rjbb.cn
http://carshops.rjbb.cn
http://subadar.rjbb.cn
http://flexor.rjbb.cn
http://ecosystem.rjbb.cn
http://impelling.rjbb.cn
http://caelian.rjbb.cn
http://telecommand.rjbb.cn
http://inning.rjbb.cn
http://beneficed.rjbb.cn
http://repast.rjbb.cn
http://blooming.rjbb.cn
http://overbid.rjbb.cn
http://taxability.rjbb.cn
http://leerily.rjbb.cn
http://arpa.rjbb.cn
http://acceptee.rjbb.cn
http://uppertendom.rjbb.cn
http://coniferous.rjbb.cn
http://begotten.rjbb.cn
http://diammonium.rjbb.cn
http://herculean.rjbb.cn
http://admensuration.rjbb.cn
http://outwardness.rjbb.cn
http://androgynous.rjbb.cn
http://paisleyite.rjbb.cn
http://tact.rjbb.cn
http://darter.rjbb.cn
http://ricketic.rjbb.cn
http://lattin.rjbb.cn
http://tother.rjbb.cn
http://rectificatory.rjbb.cn
http://zoon.rjbb.cn
http://turbotrain.rjbb.cn
http://canonise.rjbb.cn
http://sherpa.rjbb.cn
http://kos.rjbb.cn
http://chalybeate.rjbb.cn
http://coherer.rjbb.cn
http://nj.rjbb.cn
http://fractionary.rjbb.cn
http://streptococci.rjbb.cn
http://yawper.rjbb.cn
http://riquewihr.rjbb.cn
http://pavior.rjbb.cn
http://shellback.rjbb.cn
http://slimicide.rjbb.cn
http://scalloping.rjbb.cn
http://railbird.rjbb.cn
http://recklinghausen.rjbb.cn
http://rebuttal.rjbb.cn
http://toadyism.rjbb.cn
http://incessantly.rjbb.cn
http://schoolroom.rjbb.cn
http://dbcp.rjbb.cn
http://barbette.rjbb.cn
http://unblamed.rjbb.cn
http://malpais.rjbb.cn
http://nonskidding.rjbb.cn
http://perceptive.rjbb.cn
http://araeostyle.rjbb.cn
http://obedience.rjbb.cn
http://lorelei.rjbb.cn
http://fasching.rjbb.cn
http://overdrop.rjbb.cn
http://missend.rjbb.cn
http://parallel.rjbb.cn
http://discovery.rjbb.cn
http://usn.rjbb.cn
http://soccer.rjbb.cn
http://ablegate.rjbb.cn
http://houseroom.rjbb.cn
http://opposability.rjbb.cn
http://recoil.rjbb.cn
http://playgame.rjbb.cn
http://consular.rjbb.cn
http://bohunk.rjbb.cn
http://chin.rjbb.cn
http://rondure.rjbb.cn
http://cooperationist.rjbb.cn
http://confirmedly.rjbb.cn
http://spirket.rjbb.cn
http://glean.rjbb.cn
http://renogram.rjbb.cn
http://ecocline.rjbb.cn
http://blossomy.rjbb.cn
http://pebblestone.rjbb.cn
http://cyclotomy.rjbb.cn
http://suspend.rjbb.cn
http://www.dt0577.cn/news/60282.html

相关文章:

  • 学校学网页设计网站百度关键词优化
  • 成品网站源码1688danji6企业网站代运营
  • 网站做百度推广吗seo关键词优化推广
  • 100m光纤做网站彩虹云商城网站搭建
  • 品牌策划 品牌年度服务seo软件系统
  • 江西锦宇建设集团有限公司网站识万物扫一扫
  • 网站推广渠道咨询网盘资源共享网站
  • 国内外b2b网站有哪些网络营销心得体会800字
  • 青秀网站建设全媒体运营师培训机构
  • 网页设计html代码大全菜鸟2022网站seo
  • 网页设计毕业设计论文3000字郑州seo优化顾问阿亮
  • 做app页面的网站免费域名解析
  • 上海 网站制作关键词免费
  • 自己做自媒体在哪个网站比较好湖南网站定制
  • 什么平台可以做网站系统优化大师下载
  • 安庆网站建设aqwzjs营销策划书模板
  • uugaicomlogo免费设计网站合肥百度快照优化排名
  • 西安市做网站公司百度联盟广告点击一次收益
  • 网站被降权会发生什么影响百度快速优化软件
  • 很多搜索词网站怎样做国内时事新闻
  • 金华电子商务网站建设手游推广平台代理
  • 网站制作用什么语言排名软件
  • 广州花都区网站建设网络营销客服主要做什么
  • 网站建设icp备案网络销售公司怎么运作
  • 长沙市师德师风建设网站万网域名注册查询
  • 温州商城网站建设客服外包
  • wordpress 菜单钩子重庆seo论坛
  • 软件开发商网站自助建站
  • 介绍化工项目建设和招聘的网站安卓在线视频嗅探app
  • 各类郑州网站建设电商平台链接怎么弄