当前位置: 首页>>代码示例>>Golang>>正文


Golang Dwimmer.Println方法代码示例

本文整理汇总了Golang中github.com/paulfchristiano/dwimmer/dynamics.Dwimmer.Println方法的典型用法代码示例。如果您正苦于以下问题:Golang Dwimmer.Println方法的具体用法?Golang Dwimmer.Println怎么用?Golang Dwimmer.Println使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/paulfchristiano/dwimmer/dynamics.Dwimmer的用法示例。


在下文中一共展示了Dwimmer.Println方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: displayTemplate

func displayTemplate(d dynamics.Dwimmer, context *term.SettingT, quotedSetting term.T) term.T {
	setting, err := represent.ToSetting(d, quotedSetting)
	if err != nil {
		return represent.ConversionError.T(quotedSetting, err)
	}
	settingS := addNames(setting)
	ShowSettingS(d, settingS)
	d.Println("")
	d.Println("")
	quotedNames := make([]term.T, len(settingS.Names))
	for i, name := range settingS.Names {
		quotedNames[i] = represent.Str(name)
	}
	return Names.T(represent.List(quotedNames))
}
开发者ID:paulfchristiano,项目名称:dwimmer,代码行数:15,代码来源:elicit.go

示例2: OldElicitAction

func OldElicitAction(d dynamics.Dwimmer, context *term.SettingT, subject *term.Setting, hints bool) term.ActionC {
	settingS := addNames(subject)
	ShowSettingS(d, settingS)
	hint_strings := []string{}
	tool_map := make(map[rune]string)
	if hints {
		hint_strings = GetHints(d, context, settingS, 6)
		tools := similarity.SuggestedTemplates(d, subject, 6)
		if len(hint_strings) > 0 || len(tools) > 0 {
			d.Println("")
		}
		if len(tools) > 0 {
			d.Println("")
		}
		tips := []rune{'a', 's', 'd', 'w', 'e', 'j'}
		for i, tool := range tools {
			tool_map[tips[i]] = tool.String()
			d.Println(fmt.Sprintf("%c: %v", tips[i], tool))
		}
		if len(hint_strings) > 0 {
			d.Println("")
		}
		for i, hint := range hint_strings {
			d.Println(fmt.Sprintf("%d. %s", i, hint))
		}
	}
	d.Println("")
	for {
		input := d.Readln(" < ", hint_strings, tool_map)
		if input == "jump up" {
			StartShell(d, Interrupted.T(represent.SettingT(context)))
		}
		a := parsing.ParseAction(input, settingS.Names)
		if a == nil {
			c := parsing.ParseTerm(input, settingS.Names)
			if c != nil {
				switch c := c.(type) {
				case *term.CompoundC:
					if questionLike(c) {
						a = new(term.ActionC)
						*a = term.AskC(c)
					}
				case term.ReferenceC:
					a = new(term.ActionC)
					*a = term.ViewC(c)
				}
				d.Println("please input an action (ask, view, return, close, delete, correct, or tell)")
			} else {
				d.Println("that response wasn't parsed correctly")
			}
		}
		if a != nil {
			for i, n := range a.IntArgs {
				if n == -1 {
					a.IntArgs[i] = subject.Size - 1
				}
			}
			return *a
		}
	}
}
开发者ID:paulfchristiano,项目名称:dwimmer,代码行数:61,代码来源:elicit.go

示例3: ShowSettingS

func ShowSettingS(d dynamics.Dwimmer, settingS *term.SettingS) {
	d.Clear()
	for _, line := range settingS.Lines() {
		d.Println(line)
	}
}
开发者ID:paulfchristiano,项目名称:dwimmer,代码行数:6,代码来源:elicit.go


注:本文中的github.com/paulfchristiano/dwimmer/dynamics.Dwimmer.Println方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。