Finding Symbol

Hao YU
April 29th 2016

Introduction

This is a simple game - finding different symbol - with manipulable options as follows:

  • Choose different background and wanted symbols.
  • Adjust the rows and columns.
  • Change the random seed, so the position of wanted symbol will also be changed.

Besides, the symbol panel is sourced from the matrix.R script.

ui.R Code

library(shiny)
shinyUI(fluidPage(  
  titlePanel("Finding Symbol !"),

  sidebarLayout(

    sidebarPanel(
      helpText("Choose arguments for the panel !"),
      selectInput("symbol", 
                  label = "Background/Wanted Symbol",
                  choices = c("9/6", "O/0","M/N", "I/T"),
                  selected = "9/6"),

      sliderInput("row", label = h3("Row"), min = 0, max = 100, value = 50),
      sliderInput("column", label = h3("Column"), min = 0, max = 100, value = 50),
      numericInput("seed", label = h3("Set Random Seed"), value = 24)
    ), 

    mainPanel(    
      h2("Symbol Panel",align="center"),
      tableOutput("panel")
      )
  )
))

server.R Code

library(shiny)
source("matrix.R")
shinyServer(  
  function(input, output) {    
      output$panel<-renderTable({
        args <- switch(input$symbol,
                "9/6"=list("9","6"), 
                "O/0"=list("O","0"),
                "M/N"=list("M","N"), 
                "I/T"=list("I",'T'))
        args$nr <- input$row[1]
        args$nc <- input$column[1]
        args$seed <- input$seed
        do.call(alzheimer,args)
                        })
    })      

Sample Panel Display

However, the sliders of row and column, and symbol panel cannot be diplayed well. So for the full edition, see the shiny work.

<!–html_preserve–>

Finding Symbol !

Choose arguments for the panel !

Symbol Panel

<!–/html_preserve–>